[pypy-commit] pypy concurrent-marksweep: Fixes.

arigo noreply at buildbot.pypy.org
Mon Oct 24 10:48:25 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: concurrent-marksweep
Changeset: r48362:2c6f2010d4af
Date: 2011-10-24 10:47 +0200
http://bitbucket.org/pypy/pypy/changeset/2c6f2010d4af/

Log:	Fixes.

diff --git a/pypy/rpython/memory/gc/concurrentgen.py b/pypy/rpython/memory/gc/concurrentgen.py
--- a/pypy/rpython/memory/gc/concurrentgen.py
+++ b/pypy/rpython/memory/gc/concurrentgen.py
@@ -525,7 +525,10 @@
         #
         debug_start("gc-major-collection")
         #
-        # Clear this list, which is not relevant for major collections
+        # Clear this list, which is not relevant for major collections.
+        # For simplicity we first reset the markers on the objects it
+        # contains, which are all originally old objects.
+        self.flagged_objects.foreach(self._reset_flagged_root, None)
         self.flagged_objects.clear()
         #
         # Scan the stack roots and the refs in non-GC objects
@@ -589,6 +592,9 @@
         #
         self.collector.gray_objects.append(obj)
 
+    def _reset_flagged_root(self, obj, ignored):
+        self.set_mark(obj, self.collector.current_old_marker)
+
     def _add_prebuilt_root(self, obj, ignored):
         self.get_mark(obj)
         self.collector.gray_objects.append(obj)
diff --git a/pypy/rpython/memory/support.py b/pypy/rpython/memory/support.py
--- a/pypy/rpython/memory/support.py
+++ b/pypy/rpython/memory/support.py
@@ -68,6 +68,8 @@
                 # Don't cache the old chunks but free them immediately.
                 # Helps debugging, and avoids that old chunks full of
                 # addresses left behind by a test end up in genc...
+                chunk = llmemory.cast_ptr_to_adr(chunk)
+                chunk = llarena.getfakearenaaddress(chunk)
                 llarena.arena_free(chunk)
             self._unlock()
 


More information about the pypy-commit mailing list