[pypy-svn] r76756 - in pypy/branch/markcompact/pypy/rpython/memory: . gc test

arigo at codespeak.net arigo at codespeak.net
Fri Aug 27 19:26:22 CEST 2010


Author: arigo
Date: Fri Aug 27 19:26:20 2010
New Revision: 76756

Modified:
   pypy/branch/markcompact/pypy/rpython/memory/gc/markcompact.py
   pypy/branch/markcompact/pypy/rpython/memory/gcwrapper.py
   pypy/branch/markcompact/pypy/rpython/memory/test/test_gc.py
Log:
Fix tests, update.


Modified: pypy/branch/markcompact/pypy/rpython/memory/gc/markcompact.py
==============================================================================
--- pypy/branch/markcompact/pypy/rpython/memory/gc/markcompact.py	(original)
+++ pypy/branch/markcompact/pypy/rpython/memory/gc/markcompact.py	Fri Aug 27 19:26:20 2010
@@ -95,15 +95,17 @@
         ll_assert(used_space <= self.space_size,
                   "used_space + num_objects_so_far overflow")
         try:
-            next = ((used_space + requested_size) // 3) * 2
+            next = (used_space // 3) * 2 + requested_size
         except OverflowError:
             next = self.space_size
         if next < self.min_next_collect_after:
             next = self.min_next_collect_after
         if next > self.space_size - used_space:
             next = self.space_size - used_space
-        # the value we return guarantees that used_space + next <= space_size,
-        # with 'BYTES_PER_TID*num_objects_so_far' included in used_space
+        # The value we return guarantees that used_space + next <= space_size,
+        # with 'BYTES_PER_TID*num_objects_so_far' included in used_space.
+        # Normally, the value we return should also be at least requested_size
+        # unless we are out of memory.
         return next
 
     def setup(self):

Modified: pypy/branch/markcompact/pypy/rpython/memory/gcwrapper.py
==============================================================================
--- pypy/branch/markcompact/pypy/rpython/memory/gcwrapper.py	(original)
+++ pypy/branch/markcompact/pypy/rpython/memory/gcwrapper.py	Fri Aug 27 19:26:20 2010
@@ -119,6 +119,9 @@
         else:
             return True
 
+    def pyobjectptr(self, klass):
+        raise NotImplementedError(klass)
+
 # ____________________________________________________________
 
 class LLInterpRootWalker:

Modified: pypy/branch/markcompact/pypy/rpython/memory/test/test_gc.py
==============================================================================
--- pypy/branch/markcompact/pypy/rpython/memory/test/test_gc.py	(original)
+++ pypy/branch/markcompact/pypy/rpython/memory/test/test_gc.py	Fri Aug 27 19:26:20 2010
@@ -639,13 +639,11 @@
 
 class TestMarkCompactGC(TestSemiSpaceGC):
     from pypy.rpython.memory.gc.markcompact import MarkCompactGC as GCClass
+    GC_PARAMS = {'space_size': 16384}
 
     def test_finalizer_order(self):
         py.test.skip("Not implemented yet")
 
-class TestMarkCompactGCGrowing(TestMarkCompactGC):
-    GC_PARAMS = {'space_size': 16*WORD}
-
 class TestHybridGC(TestGenerationalGC):
     from pypy.rpython.memory.gc.hybrid import HybridGC as GCClass
     GC_CANNOT_MALLOC_NONMOVABLE = False



More information about the Pypy-commit mailing list