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]; }