Update Lua lua 5.4.4 rc2

This commit is contained in:
Cloud Wu
2021-12-22 11:11:25 +08:00
parent 9d3edae797
commit 5b5d5906cb
10 changed files with 98 additions and 64 deletions

View File

@@ -236,7 +236,7 @@ static void f_luaopen (lua_State *L, void *ud) {
luaS_init(L);
luaT_init(L);
luaX_init(L);
g->gcrunning = 1; /* allow gc */
g->gcstp = 0; /* allow gc */
setnilvalue(&g->nilvalue); /* now state is complete */
luai_userstateopen(L);
}
@@ -271,6 +271,7 @@ static void close_state (lua_State *L) {
if (!completestate(g)) /* closing a partially built state? */
luaC_freeallobjects(L); /* just collect its objects */
else { /* closing a fully built state */
L->ci = &L->base_ci; /* unwind CallInfo list */
luaD_closeprotected(L, 1, LUA_OK); /* close all upvalues */
luaC_freeallobjects(L); /* collect all objects */
luai_userstateclose(L);
@@ -371,7 +372,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
g->warnf = NULL;
g->ud_warn = NULL;
g->mainthread = L;
g->gcrunning = 0; /* no GC while building state */
g->gcstp = GCSTPGC; /* no GC while building state */
g->strt.size = g->strt.nuse = 0;
g->strt.hash = NULL;
setnilvalue(&g->l_registry);