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

arigo noreply at buildbot.pypy.org
Mon Apr 16 21:23:02 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54444:39116e9494e8
Date: 2012-04-16 21:21 +0200
http://bitbucket.org/pypy/pypy/changeset/39116e9494e8/

Log:	Fix the test.

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
@@ -297,6 +297,14 @@
     def _trace_drag_out1(self, root):
         self._trace_drag_out(root, None)
 
+    def _trace_drag_out_if_not_global(self, root, ignored):
+        # like _trace_drag_out(), but ignores references to GLOBAL objects.
+        # used only for the LOCAL copy of a GLOBAL object, which may still
+        # have further GLOBAL pointers.
+        obj = root.address[0]
+        if self.gc.header(obj).tid & GCFLAG_GLOBAL == 0:
+            self._trace_drag_out(root, ignored)
+
     def _trace_drag_out(self, root, ignored):
         """Trace callback: 'root' is the address of some pointer.  If that
         pointer points to a YOUNG object, allocate an OLD copy of it and
@@ -412,7 +420,7 @@
                                    self.gc.get_type_id(globalobj))
         ll_assert(TL == TG, "in a root: type(LOCAL) != type(GLOBAL)")
         #
-        self.trace_and_drag_out_of_nursery(localobj)
+        self.gc.trace(localobj, self._trace_drag_out_if_not_global, None)
 
     def collect_flush_pending(self):
         # Follow the objects in the 'pending' stack and move the


More information about the pypy-commit mailing list