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

Function luaC_freeallobjects

third-party/lua-5.5.0/src/lgc.c:1529–1540  ·  view source on GitHub ↗

** Call all finalizers of the objects in the given Lua state, and ** then free all objects, except for the main thread. */

Source from the content-addressed store, hash-verified

1527** then free all objects, except for the main thread.
1528*/
1529void luaC_freeallobjects (lua_State *L) {
1530 global_State *g = G(L);
1531 g->gcstp = GCSTPCLS; /* no extra finalizers after here */
1532 luaC_changemode(L, KGC_INC);
1533 separatetobefnz(g, 1); /* separate all objects with finalizers */
1534 lua_assert(g->finobj == NULL);
1535 callallpendingfinalizers(L);
1536 deletelist(L, g->allgc, obj2gco(mainthread(g)));
1537 lua_assert(g->finobj == NULL); /* no new finalizers */
1538 deletelist(L, g->fixedgc, NULL); /* collect fixed objects */
1539 lua_assert(g->strt.nuse == 0);
1540}
1541
1542
1543static void atomic (lua_State *L) {

Callers 1

close_stateFunction · 0.70

Calls 4

luaC_changemodeFunction · 0.70
separatetobefnzFunction · 0.70
callallpendingfinalizersFunction · 0.70
deletelistFunction · 0.70

Tested by

no test coverage detected