Blender V2.61 - r43446
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

btGenericMemoryPool Class Reference

Generic Pool class. More...

#include <btGenericPoolAllocator.h>

List of all members.

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.
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 ******************///////////
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 34 of file btGenericPoolAllocator.h.


Constructor & Destructor Documentation

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

Definition at line 56 of file btGenericPoolAllocator.h.

References init_pool().

btGenericMemoryPool::~btGenericMemoryPool ( ) [inline]

Definition at line 61 of file btGenericPoolAllocator.h.

References end_pool().


Member Function Documentation

void * btGenericMemoryPool::allocate ( size_t  size_bytes)

Allocates memory in pool.

Parameters:
size_bytessize in bytes of the buffer

Definition at line 119 of file btGenericPoolAllocator.cpp.

References allocate_from_free_nodes(), allocate_from_pool(), BT_UINT_MAX, get_element_data(), m_element_size, module, and NULL.

Referenced by btGenericPoolAllocator::allocate(), and btGenericPoolAllocator::failback_alloc().

size_t btGenericMemoryPool::allocate_from_free_nodes ( size_t  num_elements) [protected]

*************** btGenericMemoryPool ******************///////////

Definition at line 27 of file btGenericPoolAllocator.cpp.

References BT_UINT_MAX, m_allocated_sizes, m_free_nodes, and m_free_nodes_count.

Referenced by allocate().

size_t btGenericMemoryPool::allocate_from_pool ( size_t  num_elements) [protected]

Definition at line 71 of file btGenericPoolAllocator.cpp.

References BT_UINT_MAX, m_allocated_count, m_allocated_sizes, and m_max_element_count.

Referenced by allocate().

void btGenericMemoryPool::end_pool ( )
bool btGenericMemoryPool::freeMemory ( void *  pointer)
size_t btGenericMemoryPool::gem_element_size ( ) [inline]

Definition at line 72 of file btGenericPoolAllocator.h.

References m_element_size.

size_t btGenericMemoryPool::get_allocated_count ( ) [inline]

Definition at line 82 of file btGenericPoolAllocator.h.

References m_allocated_count.

void* btGenericMemoryPool::get_element_data ( size_t  element_index) [inline]

Definition at line 92 of file btGenericPoolAllocator.h.

References m_element_size, and m_pool.

Referenced by allocate().

size_t btGenericMemoryPool::get_free_positions_count ( ) [inline]

Definition at line 87 of file btGenericPoolAllocator.h.

References m_free_nodes_count.

size_t btGenericMemoryPool::get_max_element_count ( ) [inline]

Definition at line 77 of file btGenericPoolAllocator.h.

References m_max_element_count.

size_t btGenericMemoryPool::get_pool_capacity ( ) [inline]

Definition at line 67 of file btGenericPoolAllocator.h.

References m_element_size, and m_max_element_count.

Referenced by freeMemory().

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

Member Data Documentation

Definition at line 38 of file btGenericPoolAllocator.h.

Referenced by allocate_from_free_nodes(), end_pool(), freeMemory(), and init_pool().

Definition at line 37 of file btGenericPoolAllocator.h.

Referenced by end_pool(), freeMemory(), get_element_data(), and init_pool().


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