From 9319b61bfa834771ae6f26cbad4bdfc7ffb17844 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Wed, 1 May 2019 16:10:11 -0700 Subject: [PATCH] Fixed bug with ReallocRaw macro, if the memoy location moves --- microstack/ILibParsers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microstack/ILibParsers.h b/microstack/ILibParsers.h index 172a9e5..a1f6175 100644 --- a/microstack/ILibParsers.h +++ b/microstack/ILibParsers.h @@ -385,7 +385,7 @@ int ILibIsRunningOnChainThread(void* chain); void* ILibMemory_AllocateA_Init(void *buffer); #define ILibMemory_AllocateRaw(memPtr, memSize) if((memPtr = malloc(memSize)) == NULL) {ILIBCRITICALEXIT(254);} -#define ILibMemory_ReallocateRaw(memPtr, memSize) if((memPtr = realloc(memPtr, memSize)) == NULL) {ILIBCRITICALEXIT(254);} +#define ILibMemory_ReallocateRaw(ppMemory, memSize) if(((*ppMemory) = realloc(*ppMemory, memSize)) == NULL) {ILIBCRITICALEXIT(254);} void* ILibMemory_Allocate(int containerSize, int extraMemorySize, void** allocatedContainer, void **extraMemory); int ILibMemory_GetExtraMemorySize(void* extraMemory);