Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IMemPool::initialize ( MEMPOOLFLGS  nFlags,
P6UINT32  cPageSize,
P6UINT32  cInitialCount,
P6UINT32  cGrowBy,
const P6WCHAR pszName 
)
pure virtual

This method is called to initialize the memory pool for use.

At this time the memory pool will attempt to allocate cInitial allocation units.

Note
When the last reference to the pool is released, all unallocated blocks in the pool will no longer be valid, their memory will be returned to the system. This allows for the freeing of large numbers of allocations without having to free each one individually.
Parameters
nFlagsInitializations flags
MEMPOOL_NOFLAGS
MEMPOOL_ZEROMEMZero's memory contents on allocation.
MEMPOOL_USEHEAPAllocates and deallocates directly from the heap.
MEMPOOL_SETFREEMEMSpecifies that freed blocks be is set to a specific value.
MEMPOOL_ENABLEFENCESCurrently not implemnted.
cPageSizeThe allocation unit size in bytes.
cInitialCountThe initial number of allocation units to allocate.
cGrowByThe number of allocation units to grow the pool by if it runs out of allocation units. This may be set to 0 to prevent the pool from growing. If set to 0 and alloc() is called when the pool is out of allocation units, and error of eNoMemory will be returned by p6IMemPool::alloc().
pszNameThe name of this memory pool (usually the name of the block/size/or class).
Returns
SuccessP6R::eOk
FailureP6R::eInvalidArgInvalid page size, initial size and/or growby value.
P6R::eNoMemoryThere was not enough memory to satisfy the request. This can happen when growby is non-zero and the system is out of memory. Also if growby is zero and there are no available blocks in the pool.
Other valid P6R::P6ERR's