MCPcopy Create free account
hub / github.com/F-Stack/f-stack / generationalcollection

Function generationalcollection

freebsd/contrib/openzfs/module/lua/lgc.c:1116–1135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1114
1115
1116static void generationalcollection (lua_State *L) {
1117 global_State *g = G(L);
1118 lua_assert(g->gcstate == GCSpropagate);
1119 if (g->GCestimate == 0) { /* signal for another major collection? */
1120 luaC_fullgc(L, 0); /* perform a full regular collection */
1121 g->GCestimate = gettotalbytes(g); /* update control */
1122 }
1123 else {
1124 lu_mem estimate = g->GCestimate;
1125 luaC_runtilstate(L, bitmask(GCSpause)); /* run complete (minor) cycle */
1126 g->gcstate = GCSpropagate; /* skip restart */
1127 if (gettotalbytes(g) > (estimate / 100) * g->gcmajorinc)
1128 g->GCestimate = 0; /* signal for a major collection */
1129 else
1130 g->GCestimate = estimate; /* keep estimate from last major coll. */
1131
1132 }
1133 setpause(g, gettotalbytes(g));
1134 lua_assert(g->gcstate == GCSpropagate);
1135}
1136
1137
1138static void incstep (lua_State *L) {

Callers 1

luaC_forcestepFunction · 0.85

Calls 4

luaC_runtilstateFunction · 0.85
setpauseFunction · 0.85
luaC_fullgcFunction · 0.70
bitmaskClass · 0.50

Tested by

no test coverage detected