Skip to content

Commit

Permalink
fix pMemoryTop
Browse files Browse the repository at this point in the history
  • Loading branch information
aap committed Dec 5, 2020
1 parent 466eee8 commit 28a9427
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/rw/MemoryMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "MemoryMgr.h"


void *pMemoryTop;
uint8 *pMemoryTop;

void
InitMemoryMgr(void)
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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
Expand Down

0 comments on commit 28a9427

Please sign in to comment.