Bullet Collision Detection & Physics Library
Public Member Functions | Private Attributes | List of all members
btPoolAllocator Class Reference

The btPoolAllocator class allows to efficiently allocate a large pool of objects, instead of dynamically allocating them separately. More...

#include <btPoolAllocator.h>

Collaboration diagram for btPoolAllocator:
Collaboration graph
[legend]

Public Member Functions

 btPoolAllocator (int elemSize, int maxElements)
 
 ~btPoolAllocator ()
 
int getFreeCount () const
 
int getUsedCount () const
 
int getMaxCount () const
 
void * allocate (int size)
 
bool validPtr (void *ptr)
 
void freeMemory (void *ptr)
 
int getElementSize () const
 
unsigned char * getPoolAddress ()
 
const unsigned char * getPoolAddress () const
 

Private Attributes

int m_elemSize
 
int m_maxElements
 
int m_freeCount
 
void * m_firstFree
 
unsigned char * m_pool
 
btSpinMutex m_mutex
 

Detailed Description

The btPoolAllocator class allows to efficiently allocate a large pool of objects, instead of dynamically allocating them separately.

Definition at line 24 of file btPoolAllocator.h.

Constructor & Destructor Documentation

btPoolAllocator::btPoolAllocator ( int  elemSize,
int  maxElements 
)
inline

Definition at line 35 of file btPoolAllocator.h.

btPoolAllocator::~btPoolAllocator ( )
inline

Definition at line 52 of file btPoolAllocator.h.

Member Function Documentation

void* btPoolAllocator::allocate ( int  size)
inline

Definition at line 72 of file btPoolAllocator.h.

void btPoolAllocator::freeMemory ( void *  ptr)
inline

Definition at line 100 of file btPoolAllocator.h.

int btPoolAllocator::getElementSize ( ) const
inline

Definition at line 113 of file btPoolAllocator.h.

int btPoolAllocator::getFreeCount ( ) const
inline

Definition at line 57 of file btPoolAllocator.h.

int btPoolAllocator::getMaxCount ( ) const
inline

Definition at line 67 of file btPoolAllocator.h.

unsigned char* btPoolAllocator::getPoolAddress ( )
inline

Definition at line 118 of file btPoolAllocator.h.

const unsigned char* btPoolAllocator::getPoolAddress ( ) const
inline

Definition at line 123 of file btPoolAllocator.h.

int btPoolAllocator::getUsedCount ( ) const
inline

Definition at line 62 of file btPoolAllocator.h.

bool btPoolAllocator::validPtr ( void *  ptr)
inline

Definition at line 89 of file btPoolAllocator.h.

Member Data Documentation

int btPoolAllocator::m_elemSize
private

Definition at line 26 of file btPoolAllocator.h.

void* btPoolAllocator::m_firstFree
private

Definition at line 29 of file btPoolAllocator.h.

int btPoolAllocator::m_freeCount
private

Definition at line 28 of file btPoolAllocator.h.

int btPoolAllocator::m_maxElements
private

Definition at line 27 of file btPoolAllocator.h.

btSpinMutex btPoolAllocator::m_mutex
private

Definition at line 31 of file btPoolAllocator.h.

unsigned char* btPoolAllocator::m_pool
private

Definition at line 30 of file btPoolAllocator.h.


The documentation for this class was generated from the following file: