MemoryManager Class Reference

#include <MemoryManager.h>

List of all members.

Public Member Functions

 MemoryManager ()
 ~MemoryManager ()
AllocatorgetAllocator (uint16 index)
uint16 getAllocatorCount ()
void freeResources ()

Static Public Member Functions

static MemoryManagerget_instance ()
static void * allocate (size_t size)
static void deallocate (void *ptr)
static void ConCmd_MemInfo (const Console::ArgvType &argv)
static void ConCmd_test (const Console::ArgvType &argv)

Private Member Functions

void * _allocate (size_t size)
void _deallocate (void *ptr)

Private Attributes

Allocatorallocators [10]
uint16 allocatorCount

Static Private Attributes

static MemoryManagermemorymanager = 0


Detailed Description

Definition at line 24 of file MemoryManager.h.


Constructor & Destructor Documentation

MemoryManager::MemoryManager (  ) 

Definition at line 27 of file MemoryManager.cpp.

References allocate(), allocatorCount, allocators, deallocate(), memorymanager, and Pentagram::setAllocationFunctions().

MemoryManager::~MemoryManager (  ) 

Definition at line 42 of file MemoryManager.cpp.

References allocators, memorymanager, and Pentagram::setAllocationFunctions().


Member Function Documentation

void * MemoryManager::_allocate ( size_t  size  )  [private]

Definition at line 51 of file MemoryManager.cpp.

References allocate(), allocatorCount, allocators, con, and Console::Printf().

Referenced by allocate().

void MemoryManager::_deallocate ( void *  ptr  )  [private]

Definition at line 72 of file MemoryManager.cpp.

References allocatorCount, allocators, con, and Console::Printf().

Referenced by deallocate().

static void* MemoryManager::allocate ( size_t  size  )  [inline, static]

Allocates memory with the default allocator or malloc.

Definition at line 33 of file MemoryManager.h.

References _allocate(), and memorymanager.

Referenced by _allocate(), and MemoryManager().

void MemoryManager::ConCmd_MemInfo ( const Console::ArgvType argv  )  [static]

"MemoryManager::MemInfo" console command

Definition at line 102 of file MemoryManager.cpp.

References get_instance(), getAllocator(), getAllocatorCount(), pout, and Allocator::printInfo().

Referenced by GUIApp::GUIApp(), and GUIApp::~GUIApp().

void MemoryManager::ConCmd_test ( const Console::ArgvType argv  )  [static]

"MemoryManager::test" console command

Definition at line 196 of file MemoryManager.cpp.

References con, TestClassBase::next, Console::Printf(), TestClassBase::removeNext(), and TestClassBase::setNext().

Referenced by GUIApp::GUIApp(), and GUIApp::~GUIApp().

static void MemoryManager::deallocate ( void *  ptr  )  [inline, static]

Checks all known Allocators to free memory.

Definition at line 37 of file MemoryManager.h.

References _deallocate(), and memorymanager.

Referenced by MemoryManager().

void MemoryManager::freeResources (  ) 

Definition at line 93 of file MemoryManager.cpp.

References allocatorCount, and allocators.

Referenced by World::switchMap().

static MemoryManager* MemoryManager::get_instance (  )  [inline, static]

Definition at line 30 of file MemoryManager.h.

References memorymanager.

Referenced by ConCmd_MemInfo(), and World::switchMap().

Allocator* MemoryManager::getAllocator ( uint16  index  )  [inline]

Definition at line 40 of file MemoryManager.h.

References allocatorCount, and allocators.

Referenced by ConCmd_MemInfo().

uint16 MemoryManager::getAllocatorCount (  )  [inline]

Definition at line 43 of file MemoryManager.h.

References allocatorCount.

Referenced by ConCmd_MemInfo().


Member Data Documentation

uint16 MemoryManager::allocatorCount [private]

Definition at line 56 of file MemoryManager.h.

Referenced by _allocate(), _deallocate(), freeResources(), getAllocator(), getAllocatorCount(), and MemoryManager().

Allocator* MemoryManager::allocators[10] [private]

Definition at line 55 of file MemoryManager.h.

Referenced by _allocate(), _deallocate(), freeResources(), getAllocator(), MemoryManager(), and ~MemoryManager().

MemoryManager * MemoryManager::memorymanager = 0 [static, private]

Definition at line 61 of file MemoryManager.h.

Referenced by allocate(), deallocate(), get_instance(), MemoryManager(), and ~MemoryManager().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:36 2007 for pentagram by  doxygen 1.4.7