FastLED 3.9.15
|
Definition at line 183 of file allocator.h.
#include <allocator.h>
Classes | |
struct | Slab |
Public Member Functions | |
SlabAllocator () | |
SlabAllocator (const SlabAllocator &)=delete | |
SlabAllocator (SlabAllocator &&other) noexcept | |
~SlabAllocator () | |
T * | allocate (fl::size n=1) |
void | cleanup () |
void | deallocate (T *ptr, fl::size n=1) |
fl::size | getActiveAllocations () const |
fl::size | getSlabCount () const |
fl::size | getTotalAllocated () const |
fl::size | getTotalDeallocated () const |
SlabAllocator & | operator= (const SlabAllocator &)=delete |
SlabAllocator & | operator= (SlabAllocator &&other) noexcept |
Private Member Functions | |
void * | allocateFromSlab (fl::size n=1) |
Slab * | createSlab () |
void | deallocateToSlab (void *ptr, fl::size n=1) |
void * | findContiguousBlocks (Slab *slab, fl::size n) |
Private Attributes | |
Slab * | slabs_ |
fl::size | total_allocated_ |
fl::size | total_deallocated_ |
Static Private Attributes | |
static constexpr fl::size | BLOCK_SIZE = sizeof(T) > sizeof(void*) ? sizeof(T) : sizeof(void*) |
static constexpr fl::size | BLOCKS_PER_SLAB = SLAB_SIZE |
static constexpr fl::size | SLAB_MEMORY_SIZE = BLOCK_SIZE * BLOCKS_PER_SLAB |