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

Generic Pool class. More...

#include <btGenericPoolAllocator.h>

Public Member Functions

void init_pool (size_t element_size, size_t element_count)
 
void end_pool ()
 
 btGenericMemoryPool (size_t element_size, size_t element_count)
 
 ~btGenericMemoryPool ()
 
size_t get_pool_capacity ()
 
size_t gem_element_size ()
 
size_t get_max_element_count ()
 
size_t get_allocated_count ()
 
size_t get_free_positions_count ()
 
void * get_element_data (size_t element_index)
 
void * allocate (size_t size_bytes)
 Allocates memory in pool. More...
 
bool freeMemory (void *pointer)
 

Public Attributes

unsigned char * m_pool
 
size_t * m_free_nodes
 
size_t * m_allocated_sizes
 
size_t m_allocated_count
 
size_t m_free_nodes_count
 

Protected Member Functions

size_t allocate_from_free_nodes (size_t num_elements)
 *************** btGenericMemoryPool ******************‍/////////// More...
 
size_t allocate_from_pool (size_t num_elements)
 

Protected Attributes

size_t m_element_size
 
size_t m_max_element_count
 

Detailed Description

Generic Pool class.

Definition at line 33 of file btGenericPoolAllocator.h.

Constructor & Destructor Documentation

◆ btGenericMemoryPool()

btGenericMemoryPool::btGenericMemoryPool ( size_t  element_size,
size_t  element_count 
)
inline

Definition at line 54 of file btGenericPoolAllocator.h.

◆ ~btGenericMemoryPool()

btGenericMemoryPool::~btGenericMemoryPool ( )
inline

Definition at line 59 of file btGenericPoolAllocator.h.

Member Function Documentation

◆ allocate()

void * btGenericMemoryPool::allocate ( size_t  size_bytes)

Allocates memory in pool.

Parameters
size_bytessize in bytes of the buffer

Definition at line 111 of file btGenericPoolAllocator.cpp.

◆ allocate_from_free_nodes()

size_t btGenericMemoryPool::allocate_from_free_nodes ( size_t  num_elements)
protected

*************** btGenericMemoryPool ******************‍///////////

Definition at line 25 of file btGenericPoolAllocator.cpp.

◆ allocate_from_pool()

size_t btGenericMemoryPool::allocate_from_pool ( size_t  num_elements)
protected

Definition at line 68 of file btGenericPoolAllocator.cpp.

◆ end_pool()

void btGenericMemoryPool::end_pool ( )

Definition at line 98 of file btGenericPoolAllocator.cpp.

◆ freeMemory()

bool btGenericMemoryPool::freeMemory ( void *  pointer)

Definition at line 130 of file btGenericPoolAllocator.cpp.

◆ gem_element_size()

size_t btGenericMemoryPool::gem_element_size ( )
inline

Definition at line 69 of file btGenericPoolAllocator.h.

◆ get_allocated_count()

size_t btGenericMemoryPool::get_allocated_count ( )
inline

Definition at line 79 of file btGenericPoolAllocator.h.

◆ get_element_data()

void * btGenericMemoryPool::get_element_data ( size_t  element_index)
inline

Definition at line 89 of file btGenericPoolAllocator.h.

◆ get_free_positions_count()

size_t btGenericMemoryPool::get_free_positions_count ( )
inline

Definition at line 84 of file btGenericPoolAllocator.h.

◆ get_max_element_count()

size_t btGenericMemoryPool::get_max_element_count ( )
inline

Definition at line 74 of file btGenericPoolAllocator.h.

◆ get_pool_capacity()

size_t btGenericMemoryPool::get_pool_capacity ( )
inline

Definition at line 64 of file btGenericPoolAllocator.h.

◆ init_pool()

void btGenericMemoryPool::init_pool ( size_t  element_size,
size_t  element_count 
)

Definition at line 80 of file btGenericPoolAllocator.cpp.

Member Data Documentation

◆ m_allocated_count

size_t btGenericMemoryPool::m_allocated_count

Definition at line 39 of file btGenericPoolAllocator.h.

◆ m_allocated_sizes

size_t* btGenericMemoryPool::m_allocated_sizes

Definition at line 38 of file btGenericPoolAllocator.h.

◆ m_element_size

size_t btGenericMemoryPool::m_element_size
protected

Definition at line 43 of file btGenericPoolAllocator.h.

◆ m_free_nodes

size_t* btGenericMemoryPool::m_free_nodes

Definition at line 37 of file btGenericPoolAllocator.h.

◆ m_free_nodes_count

size_t btGenericMemoryPool::m_free_nodes_count

Definition at line 40 of file btGenericPoolAllocator.h.

◆ m_max_element_count

size_t btGenericMemoryPool::m_max_element_count
protected

Definition at line 44 of file btGenericPoolAllocator.h.

◆ m_pool

unsigned char* btGenericMemoryPool::m_pool

Definition at line 36 of file btGenericPoolAllocator.h.


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