MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / atomic2gen

Function atomic2gen

3rd/lua-5.4.3/src/lgc.c:1265–1284  ·  view source on GitHub ↗

** 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). */

Source from the content-addressed store, hash-verified

1263** else is turned black (not in any gray list).
1264*/
1265static 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/*

Callers 2

entergenFunction · 0.85
stepgenfullFunction · 0.85

Calls 3

cleargraylistsFunction · 0.85
sweep2oldFunction · 0.85
finishgencycleFunction · 0.85

Tested by

no test coverage detected