The btPoolAllocator class allows to efficiently allocate a large pool of objects, instead of dynamically allocating them separately. More...
#include <btPoolAllocator.h>
Public Member Functions | |
void * | allocate (int size) |
btPoolAllocator (int elemSize, int maxElements) | |
void | freeMemory (void *ptr) |
int | getElementSize () const |
int | getFreeCount () const |
int | getMaxCount () const |
unsigned char * | getPoolAddress () |
const unsigned char * | getPoolAddress () const |
int | getUsedCount () const |
bool | validPtr (void *ptr) |
~btPoolAllocator () | |
Private Attributes | |
int | m_elemSize |
void * | m_firstFree |
int | m_freeCount |
int | m_maxElements |
unsigned char * | m_pool |
The btPoolAllocator class allows to efficiently allocate a large pool of objects, instead of dynamically allocating them separately.
Definition at line 23 of file btPoolAllocator.h.
btPoolAllocator::btPoolAllocator | ( | int | elemSize, |
int | maxElements | ||
) | [inline] |
Definition at line 33 of file btPoolAllocator.h.
btPoolAllocator::~btPoolAllocator | ( | ) | [inline] |
Definition at line 50 of file btPoolAllocator.h.
void* btPoolAllocator::allocate | ( | int | size | ) | [inline] |
Definition at line 70 of file btPoolAllocator.h.
void btPoolAllocator::freeMemory | ( | void * | ptr | ) | [inline] |
Definition at line 93 of file btPoolAllocator.h.
int btPoolAllocator::getElementSize | ( | ) | const [inline] |
Definition at line 104 of file btPoolAllocator.h.
int btPoolAllocator::getFreeCount | ( | ) | const [inline] |
Definition at line 55 of file btPoolAllocator.h.
int btPoolAllocator::getMaxCount | ( | ) | const [inline] |
Definition at line 65 of file btPoolAllocator.h.
unsigned char* btPoolAllocator::getPoolAddress | ( | ) | [inline] |
Definition at line 109 of file btPoolAllocator.h.
const unsigned char* btPoolAllocator::getPoolAddress | ( | ) | const [inline] |
Definition at line 114 of file btPoolAllocator.h.
int btPoolAllocator::getUsedCount | ( | ) | const [inline] |
Definition at line 60 of file btPoolAllocator.h.
bool btPoolAllocator::validPtr | ( | void * | ptr | ) | [inline] |
Definition at line 82 of file btPoolAllocator.h.
int btPoolAllocator::m_elemSize [private] |
Definition at line 25 of file btPoolAllocator.h.
void* btPoolAllocator::m_firstFree [private] |
Definition at line 28 of file btPoolAllocator.h.
int btPoolAllocator::m_freeCount [private] |
Definition at line 27 of file btPoolAllocator.h.
int btPoolAllocator::m_maxElements [private] |
Definition at line 26 of file btPoolAllocator.h.
unsigned char* btPoolAllocator::m_pool [private] |
Definition at line 29 of file btPoolAllocator.h.