MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / lua_close

Function lua_close

Source/Misc/lua/src/lua.c:9114–9128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9112
9113
9114LUA_API void lua_close (lua_State *L) {
9115L = G(L)->mainthread; /* only the main thread can be closed */
9116lua_lock(L);
9117luaF_close(L, L->stack); /* close all upvalues for this thread */
9118luaC_separateudata(L, 1); /* separate udata that have GC metamethods */
9119L->errfunc = 0; /* no error function during GC metamethods */
9120do { /* repeat until no more errors */
9121L->ci = L->base_ci;
9122L->base = L->top = L->ci->base;
9123L->nCcalls = L->baseCcalls = 0;
9124} while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0);
9125lua_assert(G(L)->tmudata == NULL);
9126luai_userstateclose(L);
9127close_state(L);
9128}
9129
9130/*
9131** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $

Callers 1

~CtrlrLuaManagerMethod · 0.85

Calls 4

luaF_closeFunction · 0.85
luaC_separateudataFunction · 0.85
luaD_rawrunprotectedFunction · 0.85
close_stateFunction · 0.85

Tested by

no test coverage detected