mustmalloc_h, mustrealloc_h: assert on error

This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis
2025-03-09 11:21:25 +02:00
parent 563671cd1b
commit 3353c018cf

View File

@@ -143,8 +143,7 @@ void *mustmalloc_h(size_t sz, uint32 hint)
ret = Engine::memfuncs.rwmalloc(sz, hint);
if(ret || sz == 0)
return ret;
fprintf(stderr, "Error: out of memory\n");
exit(1);
assert(ret != 0);
return nil;
}
void *mustrealloc_h(void *p, size_t sz, uint32 hint)
@@ -153,8 +152,7 @@ void *mustrealloc_h(void *p, size_t sz, uint32 hint)
ret = Engine::memfuncs.rwrealloc(p, sz, hint);
if(ret || sz == 0)
return ret;
fprintf(stderr, "Error: out of memory\n");
exit(1);
assert(ret != 0);
return nil;
}