50 finalsize -= num_elements;
124 if(module>0) element_count++;
141 unsigned char * pointer_pos = (
unsigned char *)pointer;
142 unsigned char * pool_pos = (
unsigned char *)
m_pool;
144 if(pointer_pos<pool_pos)
return false;
145 size_t offset = size_t(pointer_pos - pool_pos);
242 if(result)
return true;
250 #define BT_DEFAULT_POOL_SIZE 32768
251 #define BT_DEFAULT_POOL_ELEMENT_SIZE 8
268 return g_main_allocator.
allocate(size);
274 size_t copysize = oldsize<newsize?oldsize:newsize;
275 memcpy(newptr,ptr,copysize);
void btPoolFree(void *ptr)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void * btPoolRealloc(void *ptr, size_t oldsize, size_t newsize)
#define BT_DEFAULT_POOL_ELEMENT_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()
#define BT_DEFAULT_POOL_SIZE
************** STANDARD ALLOCATOR ***************************///
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)
size_t * m_allocated_sizes
btGenericMemoryPool * push_new_pool()
#define btAlignedFree(ptr)
GIM_STANDARD_ALLOCATOR g_main_allocator
bool failback_free(void *pointer)
bool freeMemory(void *pointer)
void * failback_alloc(size_t size_bytes)
size_t get_pool_capacity()
size_t m_pool_element_count
bool freeMemory(void *pointer)
#define btAlignedAlloc(size, alignment)
void * get_element_data(size_t element_index)
size_t m_pool_element_size
size_t m_free_nodes_count
void * btPoolAlloc(size_t size)