** enter first sweep phase (strings) and prepare pointers for other ** sweep phases. The calls to 'sweeptolive' make pointers point to an ** object inside the list (instead of to the header), so that the real ** sweep do not need to skip objects created between "now" and the start ** of the real sweep. ** Returns how many objects it swept. */
| 933 | ** Returns how many objects it swept. |
| 934 | */ |
| 935 | static int entersweep (lua_State *L) { |
| 936 | global_State *g = G(L); |
| 937 | int n = 0; |
| 938 | g->gcstate = GCSsweepstring; |
| 939 | lua_assert(g->sweepgc == NULL && g->sweepfin == NULL); |
| 940 | /* prepare to sweep strings, finalizable objects, and regular objects */ |
| 941 | g->sweepstrgc = 0; |
| 942 | g->sweepfin = sweeptolive(L, &g->finobj, &n); |
| 943 | g->sweepgc = sweeptolive(L, &g->allgc, &n); |
| 944 | return n; |
| 945 | } |
| 946 | |
| 947 | |
| 948 | /* |
no test coverage detected