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

Function luaC_step

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

** Performs a basic GC step if collector is running. (If collector was ** stopped by the user, set a reasonable debt to avoid it being called ** at every single check.) */

Source from the content-addressed store, hash-verified

1738** at every single check.)
1739*/
1740void luaC_step (lua_State *L) {
1741 global_State *g = G(L);
1742 lua_assert(!g->gcemergency);
1743 if (!gcrunning(g)) { /* not running? */
1744 if (g->gcstp & GCSTPUSR) /* stopped by the user? */
1745 luaE_setdebt(g, 20000);
1746 }
1747 else {
1748 luai_tracegc(L, 1); /* for internal debugging */
1749 switch (g->gckind) {
1750 case KGC_INC: case KGC_GENMAJOR:
1751 incstep(L, g);
1752 break;
1753 case KGC_GENMINOR:
1754 youngcollection(L, g);
1755 setminordebt(g);
1756 break;
1757 }
1758 luai_tracegc(L, 0); /* for internal debugging */
1759 }
1760}
1761
1762
1763/*

Callers

nothing calls this directly

Calls 4

luaE_setdebtFunction · 0.70
incstepFunction · 0.70
youngcollectionFunction · 0.70
setminordebtFunction · 0.70

Tested by

no test coverage detected