** 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). */
| 1290 | ** else is turned black (not in any gray list). |
| 1291 | */ |
| 1292 | static void atomic2gen (lua_State *L, global_State *g) { |
| 1293 | cleargraylists(g); |
| 1294 | /* sweep all elements making them old */ |
| 1295 | g->gcstate = GCSswpallgc; |
| 1296 | sweep2old(L, &g->allgc); |
| 1297 | /* everything alive now is old */ |
| 1298 | g->reallyold = g->old1 = g->survival = g->allgc; |
| 1299 | g->firstold1 = NULL; /* there are no OLD1 objects anywhere */ |
| 1300 | |
| 1301 | /* repeat for 'finobj' lists */ |
| 1302 | sweep2old(L, &g->finobj); |
| 1303 | g->finobjrold = g->finobjold1 = g->finobjsur = g->finobj; |
| 1304 | |
| 1305 | sweep2old(L, &g->tobefnz); |
| 1306 | |
| 1307 | g->gckind = KGC_GEN; |
| 1308 | g->lastatomic = 0; |
| 1309 | g->GCestimate = gettotalbytes(g); /* base for memory control */ |
| 1310 | finishgencycle(L, g); |
| 1311 | } |
| 1312 | |
| 1313 | |
| 1314 | /* |
no test coverage detected