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

Function luaC_freeallobjects

extlibs/lua/src/lgc.c:1403–1413  ·  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

1401** then free all objects, except for the main thread.
1402*/
1403void luaC_freeallobjects (lua_State *L) {
1404 global_State *g = G(L);
1405 luaC_changemode(L, KGC_INC);
1406 separatetobefnz(g, 1); /* separate all objects with finalizers */
1407 lua_assert(g->finobj == NULL);
1408 callallpendingfinalizers(L);
1409 deletelist(L, g->allgc, obj2gco(g->mainthread));
1410 deletelist(L, g->finobj, NULL);
1411 deletelist(L, g->fixedgc, NULL); /* collect fixed objects */
1412 lua_assert(g->strt.nuse == 0);
1413}
1414
1415
1416static 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