Public Member Functions | Private Attributes | Static Private Attributes
b2BlockAllocator Class Reference

#include <b2BlockAllocator.h>

List of all members.

Public Member Functions

void * Allocate (int32 size)
 Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize.
 b2BlockAllocator ()
void Clear ()
void Free (void *p, int32 size)
 Free memory. This will use b2Free if the size is larger than b2_maxBlockSize.
 ~b2BlockAllocator ()

Private Attributes

int32 m_chunkCount
b2Chunkm_chunks
int32 m_chunkSpace
b2Blockm_freeLists [b2_blockSizes]

Static Private Attributes

static uint8 s_blockSizeLookup [b2_maxBlockSize+1]
static bool s_blockSizeLookupInitialized
static int32 s_blockSizes [b2_blockSizes]

Detailed Description

This is a small object allocator used for allocating small objects that persist for more than one time step. See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp

Definition at line 35 of file b2BlockAllocator.h.


Constructor & Destructor Documentation

Definition at line 55 of file b2BlockAllocator.cpp.

Definition at line 87 of file b2BlockAllocator.cpp.


Member Function Documentation

Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize.

Definition at line 97 of file b2BlockAllocator.cpp.

Definition at line 204 of file b2BlockAllocator.cpp.

void b2BlockAllocator::Free ( void *  p,
int32  size 
)

Free memory. This will use b2Free if the size is larger than b2_maxBlockSize.

Definition at line 155 of file b2BlockAllocator.cpp.


Member Data Documentation

Definition at line 52 of file b2BlockAllocator.h.

Definition at line 51 of file b2BlockAllocator.h.

Definition at line 53 of file b2BlockAllocator.h.

Definition at line 55 of file b2BlockAllocator.h.

Definition at line 58 of file b2BlockAllocator.h.

Definition at line 59 of file b2BlockAllocator.h.

Initial value:
 
{
        16,             
        32,             
        64,             
        96,             
        128,    
        160,    
        192,    
        224,    
        256,    
        320,    
        384,    
        448,    
        512,    
        640,    
}

Definition at line 57 of file b2BlockAllocator.h.


The documentation for this class was generated from the following files:


mvsim
Author(s):
autogenerated on Thu Sep 7 2017 09:27:48