From 8511e90b7df5daf139aba290b9c9c1595927e7b3 Mon Sep 17 00:00:00 2001 From: Roberto I Date: Wed, 22 Jul 2026 14:42:55 -0300 Subject: Bug: GC checks stack space before running finalizer If some stack does not have a minimum available space, the GC defers calling a finalizer until the next cycle. That avoids errors while running a finalizer that the programmer cannot control. --- ldo.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ldo.h') diff --git a/ldo.h b/ldo.h index 4de9540e..4c8db865 100644 --- a/ldo.h +++ b/ldo.h @@ -80,6 +80,7 @@ LUAI_FUNC int luaD_reallocstack (lua_State *L, int newsize, int raiseerror); LUAI_FUNC int luaD_growstack (lua_State *L, int n, int raiseerror); LUAI_FUNC void luaD_shrinkstack (lua_State *L); LUAI_FUNC void luaD_inctop (lua_State *L); +LUAI_FUNC int luaD_checkminstack (lua_State *L); LUAI_FUNC l_noret luaD_throw (lua_State *L, int errcode); LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); -- cgit v1.2.3-55-g6feb