Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
MemoryPoolFactory Class Reference

#include <GameMemory.h>

Public Member Functions

 MemoryPoolFactory ()
 
void init ()
 
 ~MemoryPoolFactory ()
 
MemoryPoolcreateMemoryPool (const PoolInitRec *parms)
 create a new memory pool with the given settings. if a pool with the given name already exists, return it.
 
MemoryPoolcreateMemoryPool (const char *poolName, Int allocationSize, Int initialAllocationCount, Int overflowAllocationCount)
 overloaded version of createMemoryPool with explicit parms.
 
MemoryPoolfindMemoryPool (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.
 
DynamicMemoryAllocatorcreateDynamicMemoryAllocator (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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MemoryPoolFactory()

MemoryPoolFactory::MemoryPoolFactory ( )

init the factory to safe values.

Definition at line 2581 of file GameMemory.cpp.

◆ ~MemoryPoolFactory()

MemoryPoolFactory::~MemoryPoolFactory ( )

destroy the factory, and all its pools and dmas.

Definition at line 2620 of file GameMemory.cpp.

Member Function Documentation

◆ createDynamicMemoryAllocator()

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.

◆ createMemoryPool() [1/2]

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.

◆ createMemoryPool() [2/2]

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.

◆ destroyDynamicMemoryAllocator()

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.

◆ destroyMemoryPool()

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.

◆ findMemoryPool()

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.

◆ init()

void MemoryPoolFactory::init ( )

initialize the factory.

Definition at line 2611 of file GameMemory.cpp.

◆ memoryPoolUsageReport()

void MemoryPoolFactory::memoryPoolUsageReport ( const char * filename,
FILE * appendToFileInstead = NULL )

Definition at line 2964 of file GameMemory.cpp.

◆ reset()

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.


The documentation for this class was generated from the following files: