MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaC_step

Function luaC_step

Source/Misc/lua/src/lua.c:6612–6635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6610
6611
6612void luaC_step (lua_State *L) {
6613global_State *g = G(L);
6614l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul;
6615if (lim == 0)
6616lim = (MAX_LUMEM-1)/2; /* no limit */
6617g->gcdept += g->totalbytes - g->GCthreshold;
6618do {
6619lim -= singlestep(L);
6620if (g->gcstate == GCSpause)
6621break;
6622} while (lim > 0);
6623if (g->gcstate != GCSpause) {
6624if (g->gcdept < GCSTEPSIZE)
6625g->GCthreshold = g->totalbytes + GCSTEPSIZE; /* - lim/g->gcstepmul;*/
6626else {
6627g->gcdept -= GCSTEPSIZE;
6628g->GCthreshold = g->totalbytes;
6629}
6630}
6631else {
6632lua_assert(g->totalbytes >= g->estimate);
6633setthreshold(g);
6634}
6635}
6636
6637
6638void luaC_fullgc (lua_State *L) {

Callers 1

lua_gcFunction · 0.85

Calls 1

singlestepFunction · 0.85

Tested by

no test coverage detected