MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaC_fullgc

Function luaC_fullgc

deps/lua/src/lgc.c:635–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

633
634
635void luaC_fullgc (lua_State *L) {
636 global_State *g = G(L);
637 if (g->gcstate <= GCSpropagate) {
638 /* reset sweep marks to sweep all elements (returning them to white) */
639 g->sweepstrgc = 0;
640 g->sweepgc = &g->rootgc;
641 /* reset other collector lists */
642 g->gray = NULL;
643 g->grayagain = NULL;
644 g->weak = NULL;
645 g->gcstate = GCSsweepstring;
646 }
647 lua_assert(g->gcstate != GCSpause && g->gcstate != GCSpropagate);
648 /* finish any pending sweep phase */
649 while (g->gcstate != GCSfinalize) {
650 lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep);
651 singlestep(L);
652 }
653 markroot(L);
654 while (g->gcstate != GCSpause) {
655 singlestep(L);
656 }
657 setthreshold(g);
658}
659
660
661void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) {

Callers 1

lua_gcFunction · 0.85

Calls 2

singlestepFunction · 0.85
markrootFunction · 0.85

Tested by

no test coverage detected