| 1566 | |
| 1567 | |
| 1568 | static int sweepstep (lua_State *L, global_State *g, |
| 1569 | int nextstate, GCObject **nextlist) { |
| 1570 | if (g->sweepgc) { |
| 1571 | l_mem olddebt = g->GCdebt; |
| 1572 | int count; |
| 1573 | g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX, &count); |
| 1574 | g->GCestimate += g->GCdebt - olddebt; /* update estimate */ |
| 1575 | return count; |
| 1576 | } |
| 1577 | else { /* enter next state */ |
| 1578 | g->gcstate = nextstate; |
| 1579 | g->sweepgc = nextlist; |
| 1580 | return 0; /* no work done */ |
| 1581 | } |
| 1582 | } |
| 1583 | |
| 1584 | |
| 1585 | static lu_mem singlestep (lua_State *L) { |
no test coverage detected