47 finalsize -= num_elements;
115 if (module > 0) element_count++;
132 unsigned char *pointer_pos = (
unsigned char *)pointer;
133 unsigned char *pool_pos = (
unsigned char *)
m_pool;
135 if (pointer_pos < pool_pos)
return false;
136 size_t offset = size_t(pointer_pos - pool_pos);
227 if (result)
return true;
234#define BT_DEFAULT_POOL_SIZE 32768
235#define BT_DEFAULT_POOL_ELEMENT_SIZE 8
257 size_t copysize = oldsize < newsize ? oldsize : newsize;
258 memcpy(newptr, ptr, copysize);
#define btAlignedFree(ptr)
#define btAlignedAlloc(size, alignment)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
#define BT_DEFAULT_POOL_SIZE
************** STANDARD ALLOCATOR ***************************///
GIM_STANDARD_ALLOCATOR g_main_allocator
void * btPoolRealloc(void *ptr, size_t oldsize, size_t newsize)
void * btPoolAlloc(size_t size)
#define BT_DEFAULT_POOL_ELEMENT_SIZE
void btPoolFree(void *ptr)
#define BT_DEFAULT_MAX_POOLS
size_t m_free_nodes_count
void * get_element_data(size_t element_index)
bool freeMemory(void *pointer)
size_t allocate_from_pool(size_t num_elements)
void init_pool(size_t element_size, size_t element_count)
size_t * m_allocated_sizes
size_t allocate_from_free_nodes(size_t num_elements)
*************** btGenericMemoryPool ******************///////////
void * allocate(size_t size_bytes)
Allocates memory in pool.
size_t get_pool_capacity()
size_t m_max_element_count
Generic Allocator with pools.
size_t m_pool_element_count
btGenericMemoryPool * push_new_pool()
virtual ~btGenericPoolAllocator()
*******************! btGenericPoolAllocator *******************!///
bool freeMemory(void *pointer)
btGenericMemoryPool * m_pools[BT_DEFAULT_MAX_POOLS]
void * failback_alloc(size_t size_bytes)
bool failback_free(void *pointer)
size_t get_pool_capacity()
void * allocate(size_t size_bytes)
Allocates memory in pool.
size_t m_pool_element_size