[pypy-commit] pypy stm-gc: Fix the test of 1bb21a8ad460.

arigo noreply at buildbot.pypy.org
Tue Apr 17 19:29:27 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54484:ecb25dcd128e
Date: 2012-04-17 19:29 +0200
http://bitbucket.org/pypy/pypy/changeset/ecb25dcd128e/

Log:	Fix the test of 1bb21a8ad460.

diff --git a/pypy/rpython/memory/gc/stmtls.py b/pypy/rpython/memory/gc/stmtls.py
--- a/pypy/rpython/memory/gc/stmtls.py
+++ b/pypy/rpython/memory/gc/stmtls.py
@@ -170,6 +170,7 @@
         """
         #
         debug_start("gc-local")
+        self.ending_transaction = end_of_transaction
         #
         # Move away the previous sharedarea_tls and start a new one.
         from pypy.rpython.memory.gc.stmshared import StmGCThreadLocalAllocator
@@ -312,11 +313,19 @@
         if not self.is_in_nursery(obj):
             # we ignore both GLOBAL objects and objects which have already
             # been VISITED
-            if hdr.tid & (GCFLAG_GLOBAL|GCFLAG_VISITED) == 0:
+            if hdr.tid & (GCFLAG_GLOBAL | GCFLAG_VISITED) == 0:
                 ll_assert(hdr.tid & GCFLAG_WAS_COPIED == 0,
                           "local GCFLAG_WAS_COPIED without GCFLAG_VISITED")
                 hdr.tid |= GCFLAG_VISITED
                 self.pending.append(obj)
+            else:
+                # xxx optimize this case: at the end of transactions,
+                # replace references to the local copy with references
+                # to the global copy
+                if (self.ending_transaction > 0 and
+                    hdr.tid & GCFLAG_GLOBAL == 0 and
+                    hdr.tid & GCFLAG_WAS_COPIED != 0):
+                    root.address[0] = hdr.version
             return
         #
         # If 'obj' was already forwarded, change it to its forwarding address.


More information about the pypy-commit mailing list