MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaC_freeallobjects

Function luaC_freeallobjects

3rd/lua-5.4.3/src/lgc.c:1503–1513  ·  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

1501** then free all objects, except for the main thread.
1502*/
1503void luaC_freeallobjects (lua_State *L) {
1504 global_State *g = G(L);
1505 luaC_changemode(L, KGC_INC);
1506 separatetobefnz(g, 1); /* separate all objects with finalizers */
1507 lua_assert(g->finobj == NULL);
1508 callallpendingfinalizers(L);
1509 deletelist(L, g->allgc, obj2gco(g->mainthread));
1510 deletelist(L, g->finobj, NULL);
1511 deletelist(L, g->fixedgc, NULL); /* collect fixed objects */
1512 lua_assert(g->strt.nuse == 0);
1513}
1514
1515
1516static lu_mem atomic (lua_State *L) {

Callers 1

close_stateFunction · 0.85

Calls 4

luaC_changemodeFunction · 0.85
separatetobefnzFunction · 0.85
callallpendingfinalizersFunction · 0.85
deletelistFunction · 0.85

Tested by

no test coverage detected