#include <MemoryManager.h>
Public Member Functions | |
MemoryManager () | |
~MemoryManager () | |
Allocator * | getAllocator (uint16 index) |
uint16 | getAllocatorCount () |
void | freeResources () |
Static Public Member Functions | |
static MemoryManager * | get_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 | |
Allocator * | allocators [10] |
uint16 | allocatorCount |
Static Private Attributes | |
static MemoryManager * | memorymanager = 0 |
Definition at line 24 of file MemoryManager.h.
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().
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().
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().
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().