Author: Remi Meier
Branch: c7-weakref
Changeset: r985:2a1c60c59b19
Date: 2014-03-12 17:03 +0100
http://bitbucket.org/pypy/stmgc/changeset/2a1c60c59b19/

Log:    another test

diff --git a/c7/test/test_weakref.py b/c7/test/test_weakref.py
--- a/c7/test/test_weakref.py
+++ b/c7/test/test_weakref.py
@@ -91,6 +91,27 @@
         self.abort_transaction()
         self.start_transaction()
 
+    def test_big_alloc_sizes(self):
+        sizes = [lib._STM_FAST_ALLOC + 16, 48,]
+
+        for osize in sizes:
+            self.start_transaction()
+            self.push_root_no_gc()
+            lp2 = stm_allocate(osize)
+            lp1 = stm_allocate_weakref(lp2)    # no collection here
+            self.pop_root()
+
+            assert stm_get_weakref(lp1) == lp2
+
+            self.push_root(lp1)
+            self.push_root(lp2)
+            stm_minor_collect()
+            lp2 = self.pop_root()
+            lp1 = self.pop_root()
+            # lp2 survived
+            assert stm_get_weakref(lp1) == lp2
+            self.abort_transaction()
+
 
 
 class TestMajorCollection(BaseTest):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to