libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
#include <gimbal_pool_allocator.h>
Data Fields | |
GblArenaAllocator | arena |
GblLinkedListNode | freeList |
size_t | entrySize |
size_t | entryAlign |
size_t | activeEntries |
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 at line 42 of file gimbal_pool_allocator.h.
GblArenaAllocator GblPoolAllocator::arena |
Arena allocator instance providing backing allocations.
Definition at line 43 of file gimbal_pool_allocator.h.
GblLinkedListNode GblPoolAllocator::freeList |
Link list of deleted entries for efficient recycling.
Definition at line 44 of file gimbal_pool_allocator.h.
size_t GblPoolAllocator::entrySize |
Base struct size of each entry.
Definition at line 45 of file gimbal_pool_allocator.h.
size_t GblPoolAllocator::entryAlign |
Alignment requirement for each entry.
Definition at line 46 of file gimbal_pool_allocator.h.
size_t GblPoolAllocator::activeEntries |
Number of allocated, used entries.
Definition at line 47 of file gimbal_pool_allocator.h.