MemoryMgr::CalculatePoolSize
Defined in:
Calculates the size that a pool needs to be in order to store a given number of equal-size blocks.
C4Memory.h
Prototype
static uint32 CalculatePoolSize(int32 blockCount, uint32 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