#include <pool.h>
The slot, at any given time, can be either free or occupied. If occupied - holds single instance of user object of type _T. If free - holds pointer to next free slot.
There is no direct indication or flag telling whether particular slot is free or occupied without traversing free slots list. However, this is not needed for both alloc() and free() operations, which is the trick that makes the simple allocator so fast.
Definition at line 21 of file pool.h.
Public Member Functions | |
OE_FIXED_ALLOCATOR (int block_size) | |
Construct empty memory pool. | |
~OE_FIXED_ALLOCATOR () | |
Free all pool memory and destroy the pool. | |
void * | alloc () |
Allocate another chunk of data. |
OE_FIXED_ALLOCATOR::OE_FIXED_ALLOCATOR | ( | int | block_size | ) | [inline] |
OE_FIXED_ALLOCATOR::~OE_FIXED_ALLOCATOR | ( | ) | [inline] |
void* OE_FIXED_ALLOCATOR::alloc | ( | ) | [inline] |