Skip to content

class flake::FlakeAllocator ​

STL-compatible allocator backed by the size-class byte pool. More...

#include <platform/flake/flake_alloc.h>

Public Types ​

Name
using Tvalue_type

Public Functions ​

Name
FlakeAllocator() =default
template <typename U >
FlakeAllocator(const FlakeAllocator< U > & )
T *allocate(std::size_t n)
voiddeallocate(T * p, std::size_t )

Detailed Description ​

cpp
template <typename T >
class flake::FlakeAllocator;

STL-compatible allocator backed by the size-class byte pool.

Template Parameters:

  • T Element type.

Thin adapter over flakeAlloc / flakeFree so stock STL containers (std::vector, std::map, …) draw their storage from the static pools instead of the system heap. Stateless and always equal to any other [FlakeAllocator](/embed/2.2.0/API/Classes/classflake_1_1FlakeAllocator.md), which keeps containers move-cheap and swap-safe per the C++ allocator model.

Public Types Documentation ​

using value_type ​

cpp
using flake::FlakeAllocator< T >::value_type =  T;

Public Functions Documentation ​

function FlakeAllocator ​

cpp
FlakeAllocator() =default

function FlakeAllocator ​

cpp
template <typename U >
inline FlakeAllocator(
    const FlakeAllocator< U > & 
)

function allocate ​

cpp
inline T * allocate(
    std::size_t n
)

function deallocate ​

cpp
inline void deallocate(
    T * p,
    std::size_t 
)