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

btGenericPoolAllocator Class Reference

Generic Allocator with pools. More...

#include <btGenericPoolAllocator.h>

Inheritance diagram for btGenericPoolAllocator:
Inheritance graph
[legend]

List of all members.

Public Member Functions

size_t get_pool_capacity ()
 btGenericPoolAllocator (size_t pool_element_size, size_t pool_element_count)
virtual ~btGenericPoolAllocator ()
 *******************! btGenericPoolAllocator *******************!///
void * allocate (size_t size_bytes)
 Allocates memory in pool.
bool freeMemory (void *pointer)

Public Attributes

btGenericMemoryPoolm_pools [BT_DEFAULT_MAX_POOLS]
size_t m_pool_count

Protected Member Functions

btGenericMemoryPoolpush_new_pool ()
void * failback_alloc (size_t size_bytes)
bool failback_free (void *pointer)

Protected Attributes

size_t m_pool_element_size
size_t m_pool_element_count

Detailed Description

Generic Allocator with pools.

General purpose Allocator which can create Memory Pools dynamiacally as needed.

Definition at line 113 of file btGenericPoolAllocator.h.


Constructor & Destructor Documentation

btGenericPoolAllocator::btGenericPoolAllocator ( size_t  pool_element_size,
size_t  pool_element_count 
) [inline]

Definition at line 138 of file btGenericPoolAllocator.h.

References m_pool_count, m_pool_element_count, and m_pool_element_size.

btGenericPoolAllocator::~btGenericPoolAllocator ( ) [virtual]

*******************! btGenericPoolAllocator *******************!///

Definition at line 158 of file btGenericPoolAllocator.cpp.

References btAlignedFree, btGenericMemoryPool::end_pool(), i, m_pool_count, and m_pools.


Member Function Documentation

void * btGenericPoolAllocator::allocate ( size_t  size_bytes)

Allocates memory in pool.

Parameters:
size_bytessize in bytes of the buffer

Definition at line 215 of file btGenericPoolAllocator.cpp.

References btGenericMemoryPool::allocate(), failback_alloc(), i, m_pool_count, m_pools, and NULL.

Referenced by btPoolAlloc().

void * btGenericPoolAllocator::failback_alloc ( size_t  size_bytes) [protected]
bool btGenericPoolAllocator::failback_free ( void *  pointer) [protected]

Definition at line 204 of file btGenericPoolAllocator.cpp.

References btAlignedFree.

Referenced by freeMemory().

bool btGenericPoolAllocator::freeMemory ( void *  pointer)
size_t btGenericPoolAllocator::get_pool_capacity ( ) [inline]

Definition at line 123 of file btGenericPoolAllocator.h.

References m_pool_element_count, and m_pool_element_size.

Referenced by failback_alloc().

btGenericMemoryPool * btGenericPoolAllocator::push_new_pool ( ) [protected]

Member Data Documentation


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