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

Function luaC_step

deps/lua/src/lgc.c:610–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

608
609
610void luaC_step (lua_State *L) {
611 global_State *g = G(L);
612 l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul;
613 if (lim == 0)
614 lim = (MAX_LUMEM-1)/2; /* no limit */
615 g->gcdept += g->totalbytes - g->GCthreshold;
616 do {
617 lim -= singlestep(L);
618 if (g->gcstate == GCSpause)
619 break;
620 } while (lim > 0);
621 if (g->gcstate != GCSpause) {
622 if (g->gcdept < GCSTEPSIZE)
623 g->GCthreshold = g->totalbytes + GCSTEPSIZE; /* - lim/g->gcstepmul;*/
624 else {
625 g->gcdept -= GCSTEPSIZE;
626 g->GCthreshold = g->totalbytes;
627 }
628 }
629 else {
630 setthreshold(g);
631 }
632}
633
634
635void luaC_fullgc (lua_State *L) {

Callers 1

lua_gcFunction · 0.85

Calls 1

singlestepFunction · 0.85

Tested by

no test coverage detected