undo commit 050846ada9 - lua memory allocator

Commit 050846ada9 checked for
re_alloc(NULL,n) and returned alloc(n) for that case.  After testing
MONITOR_HEAP and heaputil, the original code worked as intended.
I'm not sure what was going wrong yesterday.

Switch back to the previous code.  I could have used 'git revert'
but haven't.
This commit is contained in:
PatR
2025-04-18 20:29:27 -07:00
parent 3d5b7f1f51
commit 96a750d99e

View File

@@ -2875,9 +2875,6 @@ nhl_alloc(void *ud, void *ptr, size_t osize UNUSED, size_t nsize)
return NULL;
}
/* realloc(NULL, size) is legitimate but confuses MONITOR_HEAP */
if (!ptr)
return alloc((unsigned) nsize);
return re_alloc(ptr, (unsigned) nsize);
}