#include <GameMemory.h>
Public Member Functions | |
| MemoryPoolFactory () | |
| void | init () |
| ~MemoryPoolFactory () | |
| MemoryPool * | createMemoryPool (const PoolInitRec *parms) |
| create a new memory pool with the given settings. if a pool with the given name already exists, return it. | |
| MemoryPool * | createMemoryPool (const char *poolName, Int allocationSize, Int initialAllocationCount, Int overflowAllocationCount) |
| overloaded version of createMemoryPool with explicit parms. | |
| MemoryPool * | findMemoryPool (const char *poolName) |
| return the pool with the given name. if no such pool exists, return null. | |
| void | destroyMemoryPool (MemoryPool *pMemoryPool) |
| destroy the given pool. | |
| DynamicMemoryAllocator * | createDynamicMemoryAllocator (Int numSubPools, const PoolInitRec pParms[]) |
| create a DynamicMemoryAllocator with subpools with the given parms. | |
| void | destroyDynamicMemoryAllocator (DynamicMemoryAllocator *dma) |
| destroy the given DynamicMemoryAllocator. | |
| void | reset () |
| destroy the contents of all pools and dmas. (the pools and dma's are not destroyed, just reset) | |
| void | memoryPoolUsageReport (const char *filename, FILE *appendToFileInstead=NULL) |
The class that manages all the MemoryPools and DynamicMemoryAllocators. Usually you will create exactly one of these (TheMemoryPoolFactory) and use it for everything.
Definition at line 480 of file GameMemory.h.
| MemoryPoolFactory::MemoryPoolFactory | ( | ) |
init the factory to safe values.
Definition at line 2581 of file GameMemory.cpp.
| MemoryPoolFactory::~MemoryPoolFactory | ( | ) |
destroy the factory, and all its pools and dmas.
Definition at line 2620 of file GameMemory.cpp.
| DynamicMemoryAllocator * MemoryPoolFactory::createDynamicMemoryAllocator | ( | Int | numSubPools, |
| const PoolInitRec | pParms[] ) |
create a DynamicMemoryAllocator with subpools with the given parms.
create a new dynamicMemoryAllocator. You normally will never need to call this directly.
Definition at line 2714 of file GameMemory.cpp.
| MemoryPool * MemoryPoolFactory::createMemoryPool | ( | const char * | poolName, |
| Int | allocationSize, | ||
| Int | initialAllocationCount, | ||
| Int | overflowAllocationCount ) |
overloaded version of createMemoryPool with explicit parms.
create a new memory pool. (alternate argument list)
Definition at line 2646 of file GameMemory.cpp.
| MemoryPool * MemoryPoolFactory::createMemoryPool | ( | const PoolInitRec * | parms | ) |
create a new memory pool with the given settings. if a pool with the given name already exists, return it.
create a new memory pool.
Definition at line 2637 of file GameMemory.cpp.
| void MemoryPoolFactory::destroyDynamicMemoryAllocator | ( | DynamicMemoryAllocator * | dma | ) |
destroy the given DynamicMemoryAllocator.
destroy the given dynamicMemoryAllocator. You normally will never need to call this directly.
Definition at line 2730 of file GameMemory.cpp.
| void MemoryPoolFactory::destroyMemoryPool | ( | MemoryPool * | pMemoryPool | ) |
destroy the given pool.
destroy the given memory pool. you normally will never need to call this directly.
Definition at line 2694 of file GameMemory.cpp.
| MemoryPool * MemoryPoolFactory::findMemoryPool | ( | const char * | poolName | ) |
return the pool with the given name. if no such pool exists, return null.
find a memory pool with the given name; return null if no such pool exists, return null. note that this function isn't particularly fast (it just does a linear search), so you should probably cache the result.
Definition at line 2677 of file GameMemory.cpp.
| void MemoryPoolFactory::init | ( | ) |
initialize the factory.
Definition at line 2611 of file GameMemory.cpp.
| void MemoryPoolFactory::memoryPoolUsageReport | ( | const char * | filename, |
| FILE * | appendToFileInstead = NULL ) |
Definition at line 2964 of file GameMemory.cpp.
| void MemoryPoolFactory::reset | ( | ) |
destroy the contents of all pools and dmas. (the pools and dma's are not destroyed, just reset)
throw away everything in all pools/dmas owned by this factory, but keep the factory and pools/dmas themselves valid.
Definition at line 2749 of file GameMemory.cpp.