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

Function fullinc

lib/lua/src/lgc.c:1710–1722  ·  view source on GitHub ↗

** Perform a full collection in incremental mode. ** Before running the collection, check 'keepinvariant'; if it is true, ** there may be some objects marked as black, so the collector has ** to sweep all objects to turn them back to white (as white has not ** changed, nothing will be collected). */

Source from the content-addressed store, hash-verified

1708** changed, nothing will be collected).
1709*/
1710static void fullinc (lua_State *L, global_State *g) {
1711 if (keepinvariant(g)) /* black objects? */
1712 entersweep(L); /* sweep everything to turn them back to white */
1713 /* finish any pending sweep phase to start a new cycle */
1714 luaC_runtilstate(L, bitmask(GCSpause));
1715 luaC_runtilstate(L, bitmask(GCSpropagate)); /* start new cycle */
1716 g->gcstate = GCSenteratomic; /* go straight to atomic phase */
1717 luaC_runtilstate(L, bitmask(GCScallfin)); /* run up to finalizers */
1718 /* estimate must be correct after a full GC cycle */
1719 lua_assert(g->GCestimate == gettotalbytes(g));
1720 luaC_runtilstate(L, bitmask(GCSpause)); /* finish collection */
1721 setpause(g);
1722}
1723
1724
1725/*

Callers 1

luaC_fullgcFunction · 0.85

Calls 3

entersweepFunction · 0.85
luaC_runtilstateFunction · 0.85
setpauseFunction · 0.85

Tested by

no test coverage detected