From 96a750d99e9efe7226cff7878f30c9ef18192e5f Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 18 Apr 2025 20:29:27 -0700 Subject: [PATCH] undo commit 050846ada9 - lua memory allocator Commit 050846ada9bc62a694c6ed80d40b17f74b342629 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. --- src/nhlua.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/nhlua.c b/src/nhlua.c index bff707637..080cf1552 100644 --- a/src/nhlua.c +++ b/src/nhlua.c @@ -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); }