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 23 of file btPoolAllocator.h.

Constructor & Destructor Documentation

◆ btPoolAllocator()

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

Definition at line 33 of file btPoolAllocator.h.

◆ ~btPoolAllocator()

btPoolAllocator::~btPoolAllocator ( )
inline

Definition at line 51 of file btPoolAllocator.h.

Member Function Documentation

◆ allocate()

void * btPoolAllocator::allocate ( int  size)
inline

Definition at line 71 of file btPoolAllocator.h.

◆ freeMemory()

void btPoolAllocator::freeMemory ( void *  ptr)
inline

Definition at line 100 of file btPoolAllocator.h.

◆ getElementSize()

int btPoolAllocator::getElementSize ( ) const
inline

Definition at line 114 of file btPoolAllocator.h.

◆ getFreeCount()

int btPoolAllocator::getFreeCount ( ) const
inline

Definition at line 56 of file btPoolAllocator.h.

◆ getMaxCount()

int btPoolAllocator::getMaxCount ( ) const
inline

Definition at line 66 of file btPoolAllocator.h.

◆ getPoolAddress() [1/2]

unsigned char * btPoolAllocator::getPoolAddress ( )
inline

Definition at line 119 of file btPoolAllocator.h.

◆ getPoolAddress() [2/2]

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

Definition at line 124 of file btPoolAllocator.h.

◆ getUsedCount()

int btPoolAllocator::getUsedCount ( ) const
inline

Definition at line 61 of file btPoolAllocator.h.

◆ validPtr()

bool btPoolAllocator::validPtr ( void *  ptr)
inline

Definition at line 88 of file btPoolAllocator.h.

Member Data Documentation

◆ m_elemSize

int btPoolAllocator::m_elemSize
private

Definition at line 25 of file btPoolAllocator.h.

◆ m_firstFree

void* btPoolAllocator::m_firstFree
private

Definition at line 28 of file btPoolAllocator.h.

◆ m_freeCount

int btPoolAllocator::m_freeCount
private

Definition at line 27 of file btPoolAllocator.h.

◆ m_maxElements

int btPoolAllocator::m_maxElements
private

Definition at line 26 of file btPoolAllocator.h.

◆ m_mutex

btSpinMutex btPoolAllocator::m_mutex
private

Definition at line 30 of file btPoolAllocator.h.

◆ m_pool

unsigned char* btPoolAllocator::m_pool
private

Definition at line 29 of file btPoolAllocator.h.


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