Blender V2.61 - r43446
|
Generic Allocator with pools. More...
#include <btGenericPoolAllocator.h>
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 | |
btGenericMemoryPool * | m_pools [BT_DEFAULT_MAX_POOLS] |
size_t | m_pool_count |
Protected Member Functions | |
btGenericMemoryPool * | push_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 |
Generic Allocator with pools.
General purpose Allocator which can create Memory Pools dynamiacally as needed.
Definition at line 113 of file btGenericPoolAllocator.h.
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.
void * btGenericPoolAllocator::allocate | ( | size_t | size_bytes | ) |
Allocates memory in pool.
size_bytes | size 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] |
Definition at line 185 of file btGenericPoolAllocator.cpp.
References btGenericMemoryPool::allocate(), btAlignedAlloc, get_pool_capacity(), NULL, and push_new_pool().
Referenced by allocate().
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 | ) |
Definition at line 231 of file btGenericPoolAllocator.cpp.
References failback_free(), btGenericMemoryPool::freeMemory(), i, m_pool_count, and m_pools.
Referenced by btPoolFree().
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] |
Definition at line 171 of file btGenericPoolAllocator.cpp.
References BT_DEFAULT_MAX_POOLS, btAlignedAlloc, btGenericMemoryPool::init_pool(), m_pool_count, m_pool_element_count, m_pool_element_size, m_pools, and NULL.
Referenced by failback_alloc().
Definition at line 120 of file btGenericPoolAllocator.h.
Referenced by allocate(), btGenericPoolAllocator(), freeMemory(), push_new_pool(), and ~btGenericPoolAllocator().
size_t btGenericPoolAllocator::m_pool_element_count [protected] |
Definition at line 117 of file btGenericPoolAllocator.h.
Referenced by btGenericPoolAllocator(), get_pool_capacity(), and push_new_pool().
size_t btGenericPoolAllocator::m_pool_element_size [protected] |
Definition at line 116 of file btGenericPoolAllocator.h.
Referenced by btGenericPoolAllocator(), get_pool_capacity(), and push_new_pool().
btGenericMemoryPool* btGenericPoolAllocator::m_pools[BT_DEFAULT_MAX_POOLS] |
Definition at line 119 of file btGenericPoolAllocator.h.
Referenced by allocate(), freeMemory(), push_new_pool(), and ~btGenericPoolAllocator().