Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r25:052abdf72589
Date: 2013-05-26 19:34 +0200
http://bitbucket.org/pypy/stmgc/changeset/052abdf72589/

Log:    Give more explanations.

diff --git a/c3/gcpage.c b/c3/gcpage.c
--- a/c3/gcpage.c
+++ b/c3/gcpage.c
@@ -377,7 +377,13 @@
             return;
         }
 
-        /* then check if 'obj' was visited at all, and remove it if not */
+        /* on the other hand, if we see a non-visited object in the read
+           list, then we need to remove it --- it's wrong to just abort.
+           Consider the following case: the transaction is inevitable,
+           and since it started, it popped objects out of its shadow
+           stack.  Some popped objects might become free even if they
+           have been read from.  We must not abort such transactions
+           (and cannot anyway: they are inevitable!). */
         if (!(obj->h_tid & GCFLAG_VISITED)) {
             items[i] = items[--d->list_of_read_objects.size];
         }
diff --git a/c3/nursery.c b/c3/nursery.c
--- a/c3/nursery.c
+++ b/c3/nursery.c
@@ -624,7 +624,9 @@
            abort because of it) or it's because it was already modified.
         */
         if (obj->h_revision & 1) {
-            /* first case: untrack it */
+            /* first case: untrack it.  Note that this case can occur
+               without aborting the transaction.  See gcpage's
+               cleanup_for_thread() for an explanation how. */
             abort();//XXX
             items[i] = items[--d->list_of_read_objects.size];
         }
@@ -719,8 +721,10 @@
         stmcb_trace(items[i], &create_yo_stubs);
     }
     gcptrlist_clear(&d->private_old_pointing_to_young);
-    d->num_public_to_protected = done_creating_yo_stubs(
-            &d->public_to_young, d->num_public_to_protected);
+
+    i = d->num_public_to_protected;
+    i = done_creating_yo_stubs(&d->public_to_young, i);
+    d->num_public_to_protected = i;
 }
 
 static void free_unvisited_young_objects_outside_nursery(
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to