MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / luaC_step

Function luaC_step

other_src/lua/src/lgc.cpp:611–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

lua_gcFunction · 0.70

Calls 1

singlestepFunction · 0.70

Tested by

no test coverage detected