Photon Fusion 2.0.0

Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Allocator Struct Reference

Memory Allocator. More...

Classes

struct  Config
 Memory Allocator Configuration. More...
 

Public Member Functions

Block * GetBlock (int index)
 
Block * GetBlock (long index)
 
int GetBlockBucket (long index)
 
Block * GetBlockForPointer (void *ptr)
 
int GetBlockIndexForPointer (void *ptr)
 
byte * GetBlockMemory (Block *block)
 
byte * GetBlockMemory (long blockIndex)
 
Bucket * GetBucket (int index)
 
Bucket * GetBucketForBlock (Block *block)
 
BlockList * GetBucketList (int index)
 
bool IsPointerInMeta (void *p)
 
void * Meta (Ptr ptr)
 
Ptr Meta (void *p)
 

Static Public Member Functions

static void DebugVerifyBucketIntegrity (Allocator *a, int index)
 
static void * TryAllocateSegmentFromBlock (Allocator *a, Bucket *bucket, Block *block, int size)
 
static int WordCount (int size)
 

Public Attributes

Block * _blocks
 
BlockList * _blocksFreeList
 
Bucket * _buckets
 
BlockList * _bucketsLists
 
byte * _bucketsMap
 
void * _checksum
 
int _checksumByteLength
 
Config _config
 
void * _globals
 
byte * _heap
 
int _maxBlockIndexUsed
 
byte * _meta
 
void * _replicate
 
int _replicateByteLength
 
byte * _root
 

Static Public Attributes

const int BUCKET_COUNT = 57
 Bucket Count.
 
const byte BUCKET_INVALID = 255
 Bucket Invalid.
 
const int HEAP_ALIGNMENT = 8
 Heap Alignment.
 
const int PTR_SIZE = 8
 
const int REPLICATE_WORD_ALIGN = REPLICATE_WORD_SIZE
 Replicate Word Align.
 
const int REPLICATE_WORD_SHIFT = 2
 Replicate Word Shift.
 
const int REPLICATE_WORD_SIZE = 1 << REPLICATE_WORD_SHIFT
 Replicate Word Size.
 
const int SIZE = 112
 
const int WORD_BYTE_SIZE = 1 << 3
 
const int WORD_SHIFT = 3
 

Detailed Description

Memory Allocator.