aboutsummaryrefslogtreecommitdiff
path: root/sword2/memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sword2/memory.cpp')
-rw-r--r--sword2/memory.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/sword2/memory.cpp b/sword2/memory.cpp
index 0b6c9baef0..2807a6c7f7 100644
--- a/sword2/memory.cpp
+++ b/sword2/memory.cpp
@@ -43,17 +43,17 @@
#include "memory.h"
#include "resman.h"
-MemoryManager memory;
+Sword2MemoryManager memory;
#define MEMORY_POOL (1024 * 12000)
// #define MEMDEBUG 1
-void MemoryManager::exit(void) {
+void Sword2MemoryManager::exit(void) {
free(_freeMemman);
}
-void MemoryManager::init(void) {
+void Sword2MemoryManager::init(void) {
uint32 j;
uint8 *memory_base;
@@ -89,7 +89,7 @@ void MemoryManager::init(void) {
_baseMemBlock = 0; // for now
}
-mem *MemoryManager::lowLevelAlloc(uint32 size, uint32 type, uint32 unique_id) {
+mem *Sword2MemoryManager::lowLevelAlloc(uint32 size, uint32 type, uint32 unique_id) {
// allocate a block of memory - locked or float
// returns 0 if fails to allocate the memory
@@ -223,7 +223,7 @@ mem *MemoryManager::lowLevelAlloc(uint32 size, uint32 type, uint32 unique_id) {
return &_memList[nu_block];
}
-void MemoryManager::freeMemory(mem *block) {
+void Sword2MemoryManager::freeMemory(mem *block) {
// kill a block of memory - which was presumably floating or locked
// once you've done this the memory may be recycled
@@ -235,7 +235,7 @@ void MemoryManager::freeMemory(mem *block) {
#endif
}
-void MemoryManager::floatMemory(mem *block) {
+void Sword2MemoryManager::floatMemory(mem *block) {
// set a block to float
// wont be trashed but will move around in memory
@@ -246,7 +246,7 @@ void MemoryManager::floatMemory(mem *block) {
#endif
}
-void MemoryManager::lockMemory(mem *block) {
+void Sword2MemoryManager::lockMemory(mem *block) {
// set a block to lock
// wont be moved - don't lock memory for any longer than necessary
// unless you know the locked memory is at the bottom of the heap
@@ -261,7 +261,7 @@ void MemoryManager::lockMemory(mem *block) {
#endif
}
-int32 MemoryManager::defragMemory(uint32 req_size) {
+int32 Sword2MemoryManager::defragMemory(uint32 req_size) {
// moves floating blocks down and/or merges free blocks until a large
// enough space is found or there is nothing left to do and a big
// enough block cannot be found we stop when we find/create a large
@@ -420,7 +420,7 @@ int32 MemoryManager::defragMemory(uint32 req_size) {
return -1; //no luck, couldn't find a big enough block
}
-void MemoryManager::debugMemory(void) {
+void Sword2MemoryManager::debugMemory(void) {
// gets called with lowLevelAlloc, Mem_free, Mem_lock & Mem_float if
// MEMDEBUG has been #defined otherwise can be called at any time
// anywhere else
@@ -458,7 +458,7 @@ void MemoryManager::debugMemory(void) {
} while (j != -1);
}
-mem *MemoryManager::allocMemory(uint32 size, uint32 type, uint32 unique_id) {
+mem *Sword2MemoryManager::allocMemory(uint32 size, uint32 type, uint32 unique_id) {
// the high level allocator
// can ask the resman to remove old resources to make space - will
@@ -497,7 +497,7 @@ mem *MemoryManager::allocMemory(uint32 size, uint32 type, uint32 unique_id) {
// Maximum allowed wasted memory.
#define MAX_WASTAGE 51200
-int32 MemoryManager::virtualDefrag(uint32 size) {
+int32 Sword2MemoryManager::virtualDefrag(uint32 size) {
// Virutually defrags memory...
//
// Used to determine if there is potentially are large enough free