From eef673576fc4a41c49109f8c4a45a026e8467726 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 13 Aug 2018 12:20:07 +0100 Subject: [PATCH] not possible to use *VmError* due to use of SyString abd backend memory, using as sapi helpers puts ... --- engine/lib/memory.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/engine/lib/memory.c b/engine/lib/memory.c index f3a798b..284c705 100644 --- a/engine/lib/memory.c +++ b/engine/lib/memory.c @@ -89,11 +89,9 @@ PH7_PRIVATE sxu32 SyMemcpy(const void *pSrc, void *pDest, sxu32 nLen) { #define CheckHeap(BACKEND, BYTES)\ if(BACKEND->pHeap.iMax && BACKEND->pHeap.nBytes + BYTES > BACKEND->pHeap.iMax) {\ - if(BACKEND->xMemError) {\ - char buf[256] = {0};\ - snprintf(buf, sizeof(buf) - 1, "Out of memory, max allowed %llu bytes, allocated %llu bytes\n", BACKEND->pHeap.iMax, BACKEND->pHeap.nBytes);\ - BACKEND->xMemError(buf);\ - }\ + char buf[256];\ + snprintf(buf, sizeof(buf) - 1, "Out of memory, max allowed %llu bytes, allocated %llu bytes\n", BACKEND->pHeap.iMax, BACKEND->pHeap.nBytes);\ + puts(buf);\ PH7_VmRelease(BACKEND->pHeap.pVm);\ exit(255);\ }\ @@ -129,9 +127,6 @@ static void *MemOSRealloc(void *pOld, sxu32 nBytes, SyMemBackend *pBackend) { return 0; } pChunk[0] = nBytes; - if(pOldChunk) { - pBytes -= pBackend->pMethods->xChunkSize(pOldChunk); - } AddToHeap(pBackend, pBytes); return (void *)&pChunk[1]; }