** Clears all gray lists, sweeps objects, and prepare sublists to enter ** generational mode. The sweeps remove dead objects and turn all ** surviving objects to old. Threads go back to 'grayagain'; everything ** else is turned black (not in any gray list). */
| 1387 | ** else is turned black (not in any gray list). |
| 1388 | */ |
| 1389 | static void atomic2gen (lua_State *L, global_State *g) { |
| 1390 | cleargraylists(g); |
| 1391 | /* sweep all elements making them old */ |
| 1392 | g->gcstate = GCSswpallgc; |
| 1393 | sweep2old(L, &g->allgc); |
| 1394 | /* everything alive now is old */ |
| 1395 | g->reallyold = g->old1 = g->survival = g->allgc; |
| 1396 | g->firstold1 = NULL; /* there are no OLD1 objects anywhere */ |
| 1397 | |
| 1398 | /* repeat for 'finobj' lists */ |
| 1399 | sweep2old(L, &g->finobj); |
| 1400 | g->finobjrold = g->finobjold1 = g->finobjsur = g->finobj; |
| 1401 | |
| 1402 | sweep2old(L, &g->tobefnz); |
| 1403 | |
| 1404 | g->gckind = KGC_GENMINOR; |
| 1405 | g->GCmajorminor = g->GCmarked; /* "base" for number of bytes */ |
| 1406 | g->GCmarked = 0; /* to count the number of added old1 bytes */ |
| 1407 | finishgencycle(L, g); |
| 1408 | } |
| 1409 | |
| 1410 | |
| 1411 | /* |
no test coverage detected