1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 04:30:00 +00:00

fix pMemoryTop

This commit is contained in:
aap 2020-12-05 14:50:54 +01:00
parent 466eee84e7
commit 28a942735c

View file

@ -3,7 +3,7 @@
#include "MemoryMgr.h" #include "MemoryMgr.h"
void *pMemoryTop; uint8 *pMemoryTop;
void void
InitMemoryMgr(void) InitMemoryMgr(void)
@ -42,8 +42,8 @@ MemoryMgrMalloc(size_t size)
#else #else
void *mem = malloc(size); void *mem = malloc(size);
#endif #endif
if(mem > pMemoryTop) if((uint8*)mem + size > pMemoryTop)
pMemoryTop = mem; pMemoryTop = (uint8*)mem + size ;
return mem; return mem;
} }
@ -55,8 +55,8 @@ MemoryMgrRealloc(void *ptr, size_t size)
#else #else
void *mem = realloc(ptr, size); void *mem = realloc(ptr, size);
#endif #endif
if(mem > pMemoryTop) if((uint8*)mem + size > pMemoryTop)
pMemoryTop = mem; pMemoryTop = (uint8*)mem + size ;
return mem; return mem;
} }
@ -68,8 +68,8 @@ MemoryMgrCalloc(size_t num, size_t size)
#else #else
void *mem = calloc(num, size); void *mem = calloc(num, size);
#endif #endif
if(mem > pMemoryTop) if((uint8*)mem + size > pMemoryTop)
pMemoryTop = mem; pMemoryTop = (uint8*)mem + size ;
#ifdef FIX_BUGS #ifdef FIX_BUGS
memset(mem, 0, num*size); memset(mem, 0, num*size);
#endif #endif