MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / lua_close

Function lua_close

other_src/lua/src/lstate.cpp:205–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204
205LUA_API void lua_close (lua_State *L) {
206 L = G(L)->mainthread; /* only the main thread can be closed */
207 lua_lock(L);
208 luaF_close(L, L->stack); /* close all upvalues for this thread */
209 luaC_separateudata(L, 1); /* separate udata that have GC metamethods */
210 L->errfunc = 0; /* no error function during GC metamethods */
211 do { /* repeat until no more errors */
212 L->ci = L->base_ci;
213 L->base = L->top = L->ci->base;
214 L->nCcalls = L->baseCcalls = 0;
215 } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0);
216 lua_assert(G(L)->tmudata == NULL);
217 luai_userstateclose(L);
218 close_state(L);
219}
220

Callers 9

mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.50
killMethod · 0.50
clearMethod · 0.50
resetMethod · 0.50
LuaRobotMethod · 0.50
~LuaRobotMethod · 0.50
KillLuaMethod · 0.50

Calls 4

luaF_closeFunction · 0.70
luaC_separateudataFunction · 0.70
luaD_rawrunprotectedFunction · 0.70
close_stateFunction · 0.70

Tested by

no test coverage detected