From cc1692515e2a6aabc6d07159e7926656e38eda53 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 11 Jan 2021 15:03:01 -0300 Subject: New API function 'lua_closeslot' Closing a to-be-closed variable with 'lua_settop' is too restrictive, as it erases all slots above the variable. Moreover, it adds side effects to 'lua_settop', which should be a fairly basic function. --- lua.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index c9d64d7f..aec70dac 100644 --- a/lua.h +++ b/lua.h @@ -347,7 +347,8 @@ LUA_API size_t (lua_stringtonumber) (lua_State *L, const char *s); LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); -LUA_API void (lua_toclose) (lua_State *L, int idx); +LUA_API void (lua_toclose) (lua_State *L, int idx); +LUA_API void (lua_closeslot) (lua_State *L, int idx); /* -- cgit v1.2.3-55-g6feb