void luaE_freethread (lua_State *L, lua_State *L1) { luaF_close(L1, L1->stack); /* close all upvalues for this thread */ lua_assert(L1->openupval == NULL); luai_userstatefree(L1); freestack(L, L1); luaM_freemem(L, fromstate(L1), state_size(lua_State)); }
static void close_state (lua_State *L) { global_State *g = G(L); luaF_close(L, L->stack); /* close all upvalues for this thread */ luaC_freeall(L); /* collect all objects */ lua_assert(g->rootgc == obj2gco(L)); lua_assert(g->strt.nuse == 0); luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); luaZ_freebuffer(L, &g->buff); freestack(L, L); // lua_assert(g->totalbytes == sizeof(LG)); #if LUAPLUS_EXTENSIONS (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0, "lua.state", 0); #else (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0); #endif /* LUAPLUS_EXTENSIONS */ }
void killaE_freethread (killa_State *L, killa_State *L1) { LX *l = fromstate(L1); killaF_close(L1, L1->stack); /* close all upvalues for this thread */ killa_assert(L1->openupval == NULL); killai_userstatefree(L, L1); freestack(L1); killaM_free(L, l); }
void LUAE_freethread (LUA_State *L, LUA_State *L1) { LX *l = fromstate(L1); LUAF_close(L1, L1->stack); /* close all upvalues for this thread */ LUA_assert(L1->openupval == NULL); LUAi_userstatefree(L, L1); freestack(L1); LUAM_free(L, l); }
static void close_state (lua_State *L) { global_State *g = G(L); luaF_close(L, L->stack); /* close all upvalues for this thread */ luaC_freeallobjects(L); /* collect all objects */ luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); luaZ_freebuffer(L, &g->buff); freestack(L); lua_assert(gettotalbytes(g) == sizeof(LG)); (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ }
static void close_state (killa_State *L) { killa_GlobalState *g = KILLA_G(L); killaF_close(L, L->stack); /* close all upvalues for this thread */ killaC_freeallobjects(L); /* collect all objects */ killaM_freearray(L, KILLA_G(L)->strt.hash, KILLA_G(L)->strt.size); killaZ_freebuffer(L, &g->buff); freestack(L); killa_assert(killa_gettotalbytes(g) == sizeof(LG)); (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ }
static void close_state (lua_State *L) { global_State *g = G(L); luaF_close(L, L->stack); /* close all upvalues for this thread */ luaC_freeallobjects(L); /* collect all objects */ if (g->version) /* closing a fully built state? */ luai_userstateclose(L); luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); freestack(L); lua_assert(gettotalbytes(g) == sizeof(LG)); (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ }
static void ICACHE_FLASH_ATTR close_state (lua_State *L) { global_State *g = G(L); luaF_close(L, L->stack); /* close all upvalues for this thread */ luaC_freeall(L); /* collect all objects */ lua_assert(g->rootgc == obj2gco(L)); lua_assert(g->strt.nuse == 0); luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); luaZ_freebuffer(L, &g->buff); freestack(L, L); lua_assert(g->totalbytes == sizeof(LG)); (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0); }