21 #ifndef BT_GENERIC_POOL_ALLOCATOR_H
22 #define BT_GENERIC_POOL_ALLOCATOR_H
29 #define BT_UINT_MAX UINT_MAX
30 #define BT_DEFAULT_MAX_POOLS 16
51 void init_pool(
size_t element_size,
size_t element_count);
159 void *
btPoolRealloc(
void *ptr,
size_t oldsize,
size_t newsize);
size_t get_free_positions_count()
btGenericMemoryPool(size_t element_size, size_t element_count)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void * btPoolAlloc(size_t size)
void * allocate(size_t size_bytes)
Allocates memory in pool.
void init_pool(size_t element_size, size_t element_count)
void * allocate(size_t size_bytes)
Allocates memory in pool.
Generic Allocator with pools.
size_t get_pool_capacity()
size_t allocate_from_free_nodes(size_t num_elements)
*************** btGenericMemoryPool ******************///////////
virtual ~btGenericPoolAllocator()
*******************! btGenericPoolAllocator *******************!///
size_t m_max_element_count
#define BT_DEFAULT_MAX_POOLS
btGenericMemoryPool * m_pools[BT_DEFAULT_MAX_POOLS]
size_t allocate_from_pool(size_t num_elements)
btGenericPoolAllocator(size_t pool_element_size, size_t pool_element_count)
size_t * m_allocated_sizes
btGenericMemoryPool * push_new_pool()
bool failback_free(void *pointer)
void btPoolFree(void *ptr)
bool freeMemory(void *pointer)
void * failback_alloc(size_t size_bytes)
size_t get_pool_capacity()
void * btPoolRealloc(void *ptr, size_t oldsize, size_t newsize)
size_t m_pool_element_count
bool freeMemory(void *pointer)
size_t gem_element_size()
void * get_element_data(size_t element_index)
size_t get_max_element_count()
size_t get_allocated_count()
size_t m_pool_element_size
size_t m_free_nodes_count