aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lgc.c b/lgc.c
index faa9c902..eec73871 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1131,7 +1131,7 @@ static void correctgraylists (global_State *g) {
1131 1131
1132 1132
1133/* 1133/*
1134** Mark 'OLD1' objects when starting a new young collection. 1134** Mark black 'OLD1' objects when starting a new young collection.
1135** Gray objects are already in some gray list, and so will be visited 1135** Gray objects are already in some gray list, and so will be visited
1136** in the atomic step. 1136** in the atomic step.
1137*/ 1137*/
@@ -1140,6 +1140,7 @@ static void markold (global_State *g, GCObject *from, GCObject *to) {
1140 for (p = from; p != to; p = p->next) { 1140 for (p = from; p != to; p = p->next) {
1141 if (getage(p) == G_OLD1) { 1141 if (getage(p) == G_OLD1) {
1142 lua_assert(!iswhite(p)); 1142 lua_assert(!iswhite(p));
1143 changeage(p, G_OLD1, G_OLD); /* now they are old */
1143 if (isblack(p)) { 1144 if (isblack(p)) {
1144 black2gray(p); /* should be '2white', but gray works too */ 1145 black2gray(p); /* should be '2white', but gray works too */
1145 reallymarkobject(g, p); 1146 reallymarkobject(g, p);
@@ -1176,16 +1177,16 @@ static void youngcollection (lua_State *L, global_State *g) {
1176 /* sweep nursery and get a pointer to its last live element */ 1177 /* sweep nursery and get a pointer to its last live element */
1177 g->gcstate = GCSswpallgc; 1178 g->gcstate = GCSswpallgc;
1178 psurvival = sweepgen(L, g, &g->allgc, g->survival); 1179 psurvival = sweepgen(L, g, &g->allgc, g->survival);
1179 /* sweep 'survival' and 'old' */ 1180 /* sweep 'survival' */
1180 sweepgen(L, g, psurvival, g->reallyold); 1181 sweepgen(L, g, psurvival, g->old);
1181 g->reallyold = g->old; 1182 g->reallyold = g->old;
1182 g->old = *psurvival; /* 'survival' survivals are old now */ 1183 g->old = *psurvival; /* 'survival' survivals are old now */
1183 g->survival = g->allgc; /* all news are survivals */ 1184 g->survival = g->allgc; /* all news are survivals */
1184 1185
1185 /* repeat for 'finobj' lists */ 1186 /* repeat for 'finobj' lists */
1186 psurvival = sweepgen(L, g, &g->finobj, g->finobjsur); 1187 psurvival = sweepgen(L, g, &g->finobj, g->finobjsur);
1187 /* sweep 'survival' and 'old' */ 1188 /* sweep 'survival' */
1188 sweepgen(L, g, psurvival, g->finobjrold); 1189 sweepgen(L, g, psurvival, g->finobjold);
1189 g->finobjrold = g->finobjold; 1190 g->finobjrold = g->finobjold;
1190 g->finobjold = *psurvival; /* 'survival' survivals are old now */ 1191 g->finobjold = *psurvival; /* 'survival' survivals are old now */
1191 g->finobjsur = g->finobj; /* all news are survivals */ 1192 g->finobjsur = g->finobj; /* all news are survivals */