[pypy-commit] pypy incremental-nursery-cleanup: a seriou soops

fijal noreply at buildbot.pypy.org
Sat Feb 2 16:53:16 CET 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: incremental-nursery-cleanup
Changeset: r60818:23f2ba42a953
Date: 2013-02-02 17:52 +0200
http://bitbucket.org/pypy/pypy/changeset/23f2ba42a953/

Log:	a seriou soops

diff --git a/rpython/rtyper/memory/gc/minimark.py b/rpython/rtyper/memory/gc/minimark.py
--- a/rpython/rtyper/memory/gc/minimark.py
+++ b/rpython/rtyper/memory/gc/minimark.py
@@ -356,7 +356,7 @@
                 newsize = minsize
 
             nursery_cleanup = env.read_from_env('PYPY_GC_NURSERY_CLEANUP')
-            if nursery_cleanup >= 0:
+            if nursery_cleanup > 0:
                 self.nursery_cleanup = nursery_cleanup
             #
             major_coll = env.read_float_from_env('PYPY_GC_MAJOR_COLLECT')
@@ -410,8 +410,8 @@
         self.nursery = self._alloc_nursery()
         # the current position in the nursery:
         self.nursery_free = self.nursery
+        self.nursery_top = self.nursery + self.nursery_cleanup
         # the end of the nursery:
-        self.nursery_top = self.nursery + self.nursery_cleanup
         self.nursery_real_top = self.nursery + self.nursery_size
         # initialize the threshold
         self.min_heap_size = max(self.min_heap_size, self.nursery_size *
@@ -598,7 +598,7 @@
         if gen > 0:
             self.major_collection()
 
-    def move_nursery_top_and_malloc(self, totalsize):
+    def move_nursery_top(self, totalsize):
         llarena.arena_reset(self.nursery_top, self.nursery_cleanup, 2)
         self.nursery_top += self.nursery_cleanup
 
@@ -611,8 +611,9 @@
         and finally reserve 'totalsize' bytes at the start of the
         now-empty nursery.
         """
-        if self.nursery_top < self.nursery_real_top:
-            self.move_nursery_top_and_malloc(totalsize)
+        if (self.nursery_top < self.nursery_real_top and
+            self.nursery_free < self.nursery_real_top):
+            self.move_nursery_top(totalsize)
             return prev_result
         self.minor_collection()
         #


More information about the pypy-commit mailing list