aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/lgc.c b/lgc.c
index eec73871..347b6778 100644
--- a/lgc.c
+++ b/lgc.c
@@ -932,15 +932,15 @@ static GCObject **findlast (GCObject **p) {
932/* 932/*
933** Move all unreachable objects (or 'all' objects) that need 933** Move all unreachable objects (or 'all' objects) that need
934** finalization from list 'finobj' to list 'tobefnz' (to be finalized). 934** finalization from list 'finobj' to list 'tobefnz' (to be finalized).
935** (Note that objects after 'finobjold' cannot be white, so they 935** (Note that objects after 'finobjold1' cannot be white, so they
936** don't need to be traversed. In incremental mode, 'finobjold' is NULL, 936** don't need to be traversed. In incremental mode, 'finobjold1' is NULL,
937** so the whole list is traversed.) 937** so the whole list is traversed.)
938*/ 938*/
939static void separatetobefnz (global_State *g, int all) { 939static void separatetobefnz (global_State *g, int all) {
940 GCObject *curr; 940 GCObject *curr;
941 GCObject **p = &g->finobj; 941 GCObject **p = &g->finobj;
942 GCObject **lastnext = findlast(&g->tobefnz); 942 GCObject **lastnext = findlast(&g->tobefnz);
943 while ((curr = *p) != g->finobjold) { /* traverse all finalizable objects */ 943 while ((curr = *p) != g->finobjold1) { /* traverse all finalizable objects */
944 lua_assert(tofinalize(curr)); 944 lua_assert(tofinalize(curr));
945 if (!(iswhite(curr) || all)) /* not being collected? */ 945 if (!(iswhite(curr) || all)) /* not being collected? */
946 p = &curr->next; /* don't bother with it */ 946 p = &curr->next; /* don't bother with it */
@@ -975,8 +975,8 @@ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) {
975 else { /* correct pointers into 'allgc' list, if needed */ 975 else { /* correct pointers into 'allgc' list, if needed */
976 if (o == g->survival) 976 if (o == g->survival)
977 g->survival = o->next; 977 g->survival = o->next;
978 if (o == g->old) 978 if (o == g->old1)
979 g->old = o->next; 979 g->old1 = o->next;
980 if (o == g->reallyold) 980 if (o == g->reallyold)
981 g->reallyold = o->next; 981 g->reallyold = o->next;
982 } 982 }
@@ -1178,17 +1178,17 @@ static void youngcollection (lua_State *L, global_State *g) {
1178 g->gcstate = GCSswpallgc; 1178 g->gcstate = GCSswpallgc;
1179 psurvival = sweepgen(L, g, &g->allgc, g->survival); 1179 psurvival = sweepgen(L, g, &g->allgc, g->survival);
1180 /* sweep 'survival' */ 1180 /* sweep 'survival' */
1181 sweepgen(L, g, psurvival, g->old); 1181 sweepgen(L, g, psurvival, g->old1);
1182 g->reallyold = g->old; 1182 g->reallyold = g->old1;
1183 g->old = *psurvival; /* 'survival' survivals are old now */ 1183 g->old1 = *psurvival; /* 'survival' survivals are old now */
1184 g->survival = g->allgc; /* all news are survivals */ 1184 g->survival = g->allgc; /* all news are survivals */
1185 1185
1186 /* repeat for 'finobj' lists */ 1186 /* repeat for 'finobj' lists */
1187 psurvival = sweepgen(L, g, &g->finobj, g->finobjsur); 1187 psurvival = sweepgen(L, g, &g->finobj, g->finobjsur);
1188 /* sweep 'survival' */ 1188 /* sweep 'survival' */
1189 sweepgen(L, g, psurvival, g->finobjold); 1189 sweepgen(L, g, psurvival, g->finobjold1);
1190 g->finobjrold = g->finobjold; 1190 g->finobjrold = g->finobjold1;
1191 g->finobjold = *psurvival; /* 'survival' survivals are old now */ 1191 g->finobjold1 = *psurvival; /* 'survival' survivals are old now */
1192 g->finobjsur = g->finobj; /* all news are survivals */ 1192 g->finobjsur = g->finobj; /* all news are survivals */
1193 1193
1194 sweepgen(L, g, &g->tobefnz, NULL); 1194 sweepgen(L, g, &g->tobefnz, NULL);
@@ -1202,11 +1202,11 @@ static void atomic2gen (lua_State *L, global_State *g) {
1202 g->gcstate = GCSswpallgc; 1202 g->gcstate = GCSswpallgc;
1203 sweep2old(L, &g->allgc); 1203 sweep2old(L, &g->allgc);
1204 /* everything alive now is old */ 1204 /* everything alive now is old */
1205 g->reallyold = g->old = g->survival = g->allgc; 1205 g->reallyold = g->old1 = g->survival = g->allgc;
1206 1206
1207 /* repeat for 'finobj' lists */ 1207 /* repeat for 'finobj' lists */
1208 sweep2old(L, &g->finobj); 1208 sweep2old(L, &g->finobj);
1209 g->finobjrold = g->finobjold = g->finobjsur = g->finobj; 1209 g->finobjrold = g->finobjold1 = g->finobjsur = g->finobj;
1210 1210
1211 sweep2old(L, &g->tobefnz); 1211 sweep2old(L, &g->tobefnz);
1212 1212
@@ -1239,10 +1239,10 @@ static lu_mem entergen (lua_State *L, global_State *g) {
1239*/ 1239*/
1240static void enterinc (global_State *g) { 1240static void enterinc (global_State *g) {
1241 whitelist(g, g->allgc); 1241 whitelist(g, g->allgc);
1242 g->reallyold = g->old = g->survival = NULL; 1242 g->reallyold = g->old1 = g->survival = NULL;
1243 whitelist(g, g->finobj); 1243 whitelist(g, g->finobj);
1244 whitelist(g, g->tobefnz); 1244 whitelist(g, g->tobefnz);
1245 g->finobjrold = g->finobjold = g->finobjsur = NULL; 1245 g->finobjrold = g->finobjold1 = g->finobjsur = NULL;
1246 g->gcstate = GCSpause; 1246 g->gcstate = GCSpause;
1247 g->gckind = KGC_INC; 1247 g->gckind = KGC_INC;
1248 g->lastatomic = 0; 1248 g->lastatomic = 0;