C4 Engine Terathon Software C4 Engine API Documentation

• Memory Manager

API Links
Developer Links

MemoryMgr::CalculatePoolSize

Defined in:  C4Memory.h
Calculates the size that a pool needs to be in order to store a given number of equal-size blocks.
Prototype

static unsigned long CalculatePoolSize(long blockCount, unsigned long size);

Parameters
blockCount The number of blocks that can be stored in each pool.
size The size of each block, in bytes.
Description
The CalculatePoolSize function returns the minimum size that an allocation pool must have in order to accomodate blockCount allocations of the size specified by the size parameter. The return value accounts for the space overhead needed by the Memory Manager for each block and the overhead needed for the pool itself. This function is useful for calculating the pool size passed to the constructor for a dedicated heap. (See the Heap class.)
See Also

Memory

Heap