summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-12-05 14:50:54 +0100
committeraap <aap@papnet.eu>2020-12-05 14:50:54 +0100
commit28a942735cbcb329b572a20504b05d88e1364db6 (patch)
treed1967d36f368523e6fa8209eb8fc72f00130d2ca
parenttypo (diff)
downloadre3-28a942735cbcb329b572a20504b05d88e1364db6.tar
re3-28a942735cbcb329b572a20504b05d88e1364db6.tar.gz
re3-28a942735cbcb329b572a20504b05d88e1364db6.tar.bz2
re3-28a942735cbcb329b572a20504b05d88e1364db6.tar.lz
re3-28a942735cbcb329b572a20504b05d88e1364db6.tar.xz
re3-28a942735cbcb329b572a20504b05d88e1364db6.tar.zst
re3-28a942735cbcb329b572a20504b05d88e1364db6.zip
Diffstat (limited to '')
-rw-r--r--src/rw/MemoryMgr.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rw/MemoryMgr.cpp b/src/rw/MemoryMgr.cpp
index ef0ecbdf..e2f6f144 100644
--- a/src/rw/MemoryMgr.cpp
+++ b/src/rw/MemoryMgr.cpp
@@ -3,7 +3,7 @@
#include "MemoryMgr.h"
-void *pMemoryTop;
+uint8 *pMemoryTop;
void
InitMemoryMgr(void)
@@ -42,8 +42,8 @@ MemoryMgrMalloc(size_t size)
#else
void *mem = malloc(size);
#endif
- if(mem > pMemoryTop)
- pMemoryTop = mem;
+ if((uint8*)mem + size > pMemoryTop)
+ pMemoryTop = (uint8*)mem + size ;
return mem;
}
@@ -55,8 +55,8 @@ MemoryMgrRealloc(void *ptr, size_t size)
#else
void *mem = realloc(ptr, size);
#endif
- if(mem > pMemoryTop)
- pMemoryTop = mem;
+ if((uint8*)mem + size > pMemoryTop)
+ pMemoryTop = (uint8*)mem + size ;
return mem;
}
@@ -68,8 +68,8 @@ MemoryMgrCalloc(size_t num, size_t size)
#else
void *mem = calloc(num, size);
#endif
- if(mem > pMemoryTop)
- pMemoryTop = mem;
+ if((uint8*)mem + size > pMemoryTop)
+ pMemoryTop = (uint8*)mem + size ;
#ifdef FIX_BUGS
memset(mem, 0, num*size);
#endif