19 #ifndef B2_BLOCK_ALLOCATOR_H
20 #define B2_BLOCK_ALLOCATOR_H
23 #include <Box2D/Common/b2TrackedBlock.h>
25 const int32 b2_chunkSize = 16 * 1024;
26 const int32 b2_maxBlockSize = 640;
27 const int32 b2_blockSizes = 14;
28 const int32 b2_chunkArrayIncrement = 128;
46 void Free(
void* p, int32 size);
58 b2Block* m_freeLists[b2_blockSizes];
63 static int32 s_blockSizes[b2_blockSizes];
64 static uint8 s_blockSizeLookup[b2_maxBlockSize + 1];
65 static bool s_blockSizeLookupInitialized;
void Free(void *p, int32 size)
Free memory. This uses b2Free if the size is larger than b2_maxBlockSize.
Definition: b2BlockAllocator.cpp:163
Definition: b2BlockAllocator.h:36
uint32 GetNumGiantAllocations() const
Returns the number of allocations larger than the max block size.
Definition: b2BlockAllocator.cpp:100
void * Allocate(int32 size)
Allocate memory. This uses b2Alloc if the size is larger than b2_maxBlockSize.
Definition: b2BlockAllocator.cpp:105
Allocator of blocks which are tracked in a list.
Definition: b2TrackedBlock.h:62