** 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). */
| 1263 | ** else is turned black (not in any gray list). |
| 1264 | */ |
| 1265 | static void atomic2gen (lua_State *L, global_State *g) { |
| 1266 | cleargraylists(g); |
| 1267 | /* sweep all elements making them old */ |
| 1268 | g->gcstate = GCSswpallgc; |
| 1269 | sweep2old(L, &g->allgc); |
| 1270 | /* everything alive now is old */ |
| 1271 | g->reallyold = g->old1 = g->survival = g->allgc; |
| 1272 | g->firstold1 = NULL; /* there are no OLD1 objects anywhere */ |
| 1273 | |
| 1274 | /* repeat for 'finobj' lists */ |
| 1275 | sweep2old(L, &g->finobj); |
| 1276 | g->finobjrold = g->finobjold1 = g->finobjsur = g->finobj; |
| 1277 | |
| 1278 | sweep2old(L, &g->tobefnz); |
| 1279 | |
| 1280 | g->gckind = KGC_GEN; |
| 1281 | g->lastatomic = 0; |
| 1282 | g->GCestimate = gettotalbytes(g); /* base for memory control */ |
| 1283 | finishgencycle(L, g); |
| 1284 | } |
| 1285 | |
| 1286 | |
| 1287 | /* |
no test coverage detected