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

Function luaC_changemode

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

** change GC mode */

Source from the content-addressed store, hash-verified

949** change GC mode
950*/
951void luaC_changemode (lua_State *L, int mode) {
952 global_State *g = G(L);
953 if (mode == g->gckind) return; /* nothing to change */
954 if (mode == KGC_GEN) { /* change to generational mode */
955 /* make sure gray lists are consistent */
956 luaC_runtilstate(L, bitmask(GCSpropagate));
957 g->GCestimate = gettotalbytes(g);
958 g->gckind = KGC_GEN;
959 }
960 else { /* change to incremental mode */
961 /* sweep all objects to turn them back to white
962 (as white has not changed, nothing extra will be collected) */
963 g->gckind = KGC_NORMAL;
964 entersweep(L);
965 luaC_runtilstate(L, ~sweepphases);
966 }
967}
968
969
970/*

Callers 1

lua_gcFunction · 0.85

Calls 3

luaC_runtilstateFunction · 0.85
entersweepFunction · 0.85
bitmaskClass · 0.50

Tested by

no test coverage detected