diff options
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1121,6 +1121,7 @@ static GCObject **sweepgen (lua_State *L, global_State *g, GCObject **p, | |||
1121 | curr->marked = cast_byte(marked | G_SURVIVAL | white); | 1121 | curr->marked = cast_byte(marked | G_SURVIVAL | white); |
1122 | } | 1122 | } |
1123 | else { /* all other objects will be old, and so keep their color */ | 1123 | else { /* all other objects will be old, and so keep their color */ |
1124 | lua_assert(getage(curr) != G_OLD1); /* advanced in 'markold' */ | ||
1124 | setage(curr, nextage[getage(curr)]); | 1125 | setage(curr, nextage[getage(curr)]); |
1125 | if (getage(curr) == G_OLD1 && *pfirstold1 == NULL) | 1126 | if (getage(curr) == G_OLD1 && *pfirstold1 == NULL) |
1126 | *pfirstold1 = curr; /* first OLD1 object in the list */ | 1127 | *pfirstold1 = curr; /* first OLD1 object in the list */ |
@@ -1145,13 +1146,15 @@ static void whitelist (global_State *g, GCObject *p) { | |||
1145 | 1146 | ||
1146 | 1147 | ||
1147 | /* | 1148 | /* |
1148 | ** Correct a list of gray objects. Return pointer to where rest of the | 1149 | ** Correct a list of gray objects. Return a pointer to the last element |
1149 | ** list should be linked. | 1150 | ** left on the list, so that we can link another list to the end of |
1151 | ** this one. | ||
1150 | ** Because this correction is done after sweeping, young objects might | 1152 | ** Because this correction is done after sweeping, young objects might |
1151 | ** be turned white and still be in the list. They are only removed. | 1153 | ** be turned white and still be in the list. They are only removed. |
1152 | ** 'TOUCHED1' objects are advanced to 'TOUCHED2' and remain on the list; | 1154 | ** 'TOUCHED1' objects are advanced to 'TOUCHED2' and remain on the list; |
1153 | ** Non-white threads also remain on the list; 'TOUCHED2' objects become | 1155 | ** Non-white threads also remain on the list. 'TOUCHED2' objects and |
1154 | ** regular old; they and anything else are removed from the list. | 1156 | ** anything else become regular old, are marked black, and are removed |
1157 | ** from the list. | ||
1155 | */ | 1158 | */ |
1156 | static GCObject **correctgraylist (GCObject **p) { | 1159 | static GCObject **correctgraylist (GCObject **p) { |
1157 | GCObject *curr; | 1160 | GCObject *curr; |