[pypy-commit] pypy default: Tweak collect(0), collect(1), collect(2).

arigo noreply at buildbot.pypy.org
Tue Oct 15 12:10:44 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r67391:24146d14cfb0
Date: 2013-10-15 12:10 +0200
http://bitbucket.org/pypy/pypy/changeset/24146d14cfb0/

Log:	Tweak collect(0), collect(1), collect(2).

diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -653,12 +653,15 @@
         return llmemory.cast_adr_to_ptr(obj, llmemory.GCREF)
 
 
-    def collect(self, gen=1):
-        """Do a minor (gen=0) or full major (gen>0) collection."""
-        if gen > 0:
+    def collect(self, gen=2):
+        """Do a minor (gen=0), start a major (gen=1), or do a full
+        major (gen>=2) collection."""
+        if gen <= 1:
+            self.minor_collection()
+            if gen == 1 or self.gc_state != STATE_SCANNING:
+                self.major_collection_step()
+        else:
             self.minor_and_major_collection()
-        else:
-            self.minor_collection()
 
     def move_nursery_top(self, totalsize):
         size = self.nursery_cleanup


More information about the pypy-commit mailing list