C4 Engine
C4 Engine API Documentation

class Heap

Defined in:  C4Memory.h
The Heap class encapsulates a memory allocation heap.
Definition

class Heap

Member Functions
Heap::GetTotalSize Returns the total size of allocated blocks in a heap.
Constructor

Heap(const char *name = nullptruint32 pool = kMemoryDefaultPoolSize, uint32 flags = 0);

Parameters
name The name of the heap.
pool The size of the memory pools allocated in the heap, in bytes.
flags The heap flags. See below for possible values.
Description
The Heap class organizes a set of memory pools from which blocks of memory are allocated by the Memory Manager. Heaps are generally managed internally by the engine, but it is possible to create new dedicated heaps for custom class types by subclassing from the Memory class.

The flags parameter can be a combination (through logical OR) of the following constants.
kHeapMutexless Do not use a mutex to protect the heap from simultaneous access from multiple threads.
See Also

Memory

MemoryMgr::CalculatePoolSize