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