[pypy-commit] stmgc c7-refactor: Next test passes

arigo noreply at buildbot.pypy.org
Sun Feb 23 16:32:46 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: c7-refactor
Changeset: r815:8a68e946b423
Date: 2014-02-23 15:34 +0100
http://bitbucket.org/pypy/stmgc/changeset/8a68e946b423/

Log:	Next test passes

diff --git a/c7/test/support.py b/c7/test/support.py
--- a/c7/test/support.py
+++ b/c7/test/support.py
@@ -373,7 +373,7 @@
                      ffi.cast("object_t *", -1)))
 
 
-SHADOWSTACK_LENGTH = 100
+SHADOWSTACK_LENGTH = 1000
 _keepalive = weakref.WeakKeyDictionary()
 
 def _allocate_thread_local():
diff --git a/c7/test/test_nursery.py b/c7/test/test_nursery.py
--- a/c7/test/test_nursery.py
+++ b/c7/test/test_nursery.py
@@ -105,18 +105,21 @@
         assert lp2 == lp3
 
     def test_many_allocs(self):
+        lib._stm_set_nursery_free_count(NURSERY_SECTION_SIZE * 2)
         obj_size = 1024
-        num = (lib.NB_NURSERY_PAGES * 4096) / obj_size + 100 # more than what fits in the nursery
+        num = (NURSERY_SECTION_SIZE * 4) / obj_size + 41
 
         self.start_transaction()
         for i in range(num):
             new = stm_allocate(obj_size)
+            stm_set_char(new, chr(i % 255))
             self.push_root(new)
 
         old = []
         young = []
-        for _ in range(num):
+        for i in reversed(range(num)):
             r = self.pop_root()
+            assert stm_get_char(r) == chr(i % 255)
             if is_in_nursery(r):
                 young.append(r)
             else:


More information about the pypy-commit mailing list