libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
Go to the source code of this file.
Data Structures | |
struct | GblPoolAllocator |
Macros | |
#define | GblPoolAllocator_construct(...) |
Functions | |
GBL_RESULT | GblPoolAllocator_construct (GblPoolAllocator *pSelf, size_t entrySize, size_t entriesPerPage, size_t entryAlign, GblArenaAllocatorPage *pInitialPage, GblContext *pCtx) |
GBL_RESULT | GblPoolAllocator_destruct (GblPoolAllocator *pSelf) |
size_t | GblPoolAllocator_freeListSize (const GblPoolAllocator *pSelf) |
void * | GblPoolAllocator_new (GblPoolAllocator *pSelf) |
GBL_RESULT | GblPoolAllocator_delete (GblPoolAllocator *pSelf, void *pEntry) |
GblPoolAllocator arena-backed, pool-based allocator.
Pool allocator for ultra-fast fixed-size allocations.
GblPoolAllocator is a custsom allocator providing extremely efficient dynamic allocations and deallocations for data of a fixed size. Allocations are done in bulk as single pages which are then split up into individual allocation entries. Since the pool allocator is built upon an arena allocator, when the initial page chunk overflows, the allocator will gracefully allocate another, so it's still able to dynamically accomodate arbitrary numbers of allocations.
The pool allocator constructs and maintains a free list of deleted entries (embedded within the unused allocations themselves), so a previously freed entry can be immediately recycled when a new allocation is requested.
The allocator also supports enforcing custom alignment constraints on each requested allocation.
Definition in file gimbal_pool_allocator.h.
#define GblPoolAllocator_construct | ( | ... | ) |
Definition at line 66 of file gimbal_pool_allocator.h.