MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / close_state

Function close_state

third-party/lua-5.2.4/src/lstate.c:223–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221
222
223static void close_state (lua_State *L) {
224 global_State *g = G(L);
225 luaF_close(L, L->stack); /* close all upvalues for this thread */
226 luaC_freeallobjects(L); /* collect all objects */
227 if (g->version) /* closing a fully built state? */
228 luai_userstateclose(L);
229 luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size);
230 luaZ_freebuffer(L, &g->buff);
231 freestack(L);
232 lua_assert(gettotalbytes(g) == sizeof(LG));
233 (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */
234}
235
236
237LUA_API lua_State *lua_newthread (lua_State *L) {

Callers 2

lua_newstateFunction · 0.70
lua_closeFunction · 0.70

Calls 3

luaF_closeFunction · 0.70
luaC_freeallobjectsFunction · 0.70
freestackFunction · 0.70

Tested by

no test coverage detected