Planeshift
|
#include <poolallocator.h>
Classes | |
struct | st_freelist_member |
A structure used to track free blocks. | |
struct | st_pool_entry |
A structure used as a header for each allocation "pool". | |
Public Member Functions | |
void | CallFromDelete (TEMPLATE_CLASS *obj) |
Places a block back on the list of available blocks. Does NOT release memory back to the heap - ever. | |
TEMPLATE_CLASS * | CallFromNew () |
Returns a new block from the list of available blocks. Allocates another pool if necessary. | |
bool | PointerCameFromPool (void *ptr) |
PoolAllocator (int items_per_pool=POOLALLOC_DEFAULT_ALLOCATION_OBJECTS) | |
PoolAllocator constructor. Sets list heads to NULL and the per-pool object count to the passed value (or default). | |
~PoolAllocator () | |
PoolAllocator destructor. Releases the memory assigned to the pools back to the heap and clears the pool and free lists. |
Definition at line 80 of file poolallocator.h.
PoolAllocator< TEMPLATE_CLASS >::PoolAllocator | ( | int | items_per_pool = POOLALLOC_DEFAULT_ALLOCATION_OBJECTS | ) | [inline] |
PoolAllocator constructor. Sets list heads to NULL and the per-pool object count to the passed value (or default).
Definition at line 114 of file poolallocator.h.
PoolAllocator< TEMPLATE_CLASS >::~PoolAllocator | ( | ) | [inline] |
PoolAllocator destructor. Releases the memory assigned to the pools back to the heap and clears the pool and free lists.
Definition at line 122 of file poolallocator.h.
void PoolAllocator< TEMPLATE_CLASS >::CallFromDelete | ( | TEMPLATE_CLASS * | obj | ) | [inline] |
Places a block back on the list of available blocks. Does NOT release memory back to the heap - ever.
Definition at line 164 of file poolallocator.h.
TEMPLATE_CLASS* PoolAllocator< TEMPLATE_CLASS >::CallFromNew | ( | ) | [inline] |
Returns a new block from the list of available blocks. Allocates another pool if necessary.
Definition at line 139 of file poolallocator.h.
bool PoolAllocator< TEMPLATE_CLASS >::PointerCameFromPool | ( | void * | ptr | ) | [inline] |
Definition at line 187 of file poolallocator.h.