| 1027 | |
| 1028 | |
| 1029 | static lu_mem sweepstep (lua_State *L, global_State *g, |
| 1030 | int nextstate, GCObject **nextlist) { |
| 1031 | if (g->sweepgc) { |
| 1032 | l_mem olddebt = g->GCdebt; |
| 1033 | g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX); |
| 1034 | g->GCestimate += g->GCdebt - olddebt; /* update estimate */ |
| 1035 | if (g->sweepgc) /* is there still something to sweep? */ |
| 1036 | return (GCSWEEPMAX * GCSWEEPCOST); |
| 1037 | } |
| 1038 | /* else enter next state */ |
| 1039 | g->gcstate = nextstate; |
| 1040 | g->sweepgc = nextlist; |
| 1041 | return 0; |
| 1042 | } |
| 1043 | |
| 1044 | |
| 1045 | static lu_mem singlestep (lua_State *L) { |
no test coverage detected