MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaC_freeallobjects

Function luaC_freeallobjects

lib/lua/src/lgc.c:1511–1522  ·  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

1509** then free all objects, except for the main thread.
1510*/
1511void luaC_freeallobjects (lua_State *L) {
1512 global_State *g = G(L);
1513 g->gcstp = GCSTPCLS; /* no extra finalizers after here */
1514 luaC_changemode(L, KGC_INC);
1515 separatetobefnz(g, 1); /* separate all objects with finalizers */
1516 lua_assert(g->finobj == NULL);
1517 callallpendingfinalizers(L);
1518 deletelist(L, g->allgc, obj2gco(g->mainthread));
1519 lua_assert(g->finobj == NULL); /* no new finalizers */
1520 deletelist(L, g->fixedgc, NULL); /* collect fixed objects */
1521 lua_assert(g->strt.nuse == 0);
1522}
1523
1524
1525static lu_mem atomic (lua_State *L) {

Callers 1

close_stateFunction · 0.85

Calls 5

luaC_changemodeFunction · 0.85
separatetobefnzFunction · 0.85
callallpendingfinalizersFunction · 0.85
deletelistFunction · 0.85
GFunction · 0.50

Tested by

no test coverage detected