'lua_toclose' gets the index to be closed as an argument

Sometimes it is useful to mark to-be-closed an index that is not
at the top of the stack (e.g., if the value to be closed came from
a function call returning multiple values).
This commit is contained in:
Roberto Ierusalimschy
2018-11-12 14:15:50 -02:00
parent 9eafe9c053
commit 5fda30b4f9
4 changed files with 22 additions and 13 deletions

2
lua.h
View File

@@ -333,7 +333,7 @@ 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);
LUA_API void (lua_toclose) (lua_State *L, int idx);
/*