MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / close_state

Function close_state

extlibs/lua/src/lstate.c:300–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298
299
300static void close_state (lua_State *L) {
301 global_State *g = G(L);
302 luaF_close(L, L->stack, CLOSEPROTECT); /* close all upvalues */
303 luaC_freeallobjects(L); /* collect all objects */
304 if (ttisnil(&g->nilvalue)) /* closing a fully built state? */
305 luai_userstateclose(L);
306 luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size);
307 freestack(L);
308 lua_assert(gettotalbytes(g) == sizeof(LG));
309 (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */
310}
311
312
313LUA_API lua_State *lua_newthread (lua_State *L) {

Callers 2

lua_newstateFunction · 0.85
lua_closeFunction · 0.85

Calls 3

luaF_closeFunction · 0.85
luaC_freeallobjectsFunction · 0.85
freestackFunction · 0.85

Tested by

no test coverage detected