[pypy-commit] stmgc default: Another test that the pushed abort_info objects are kept alive

arigo noreply at buildbot.pypy.org
Fri Sep 6 19:50:24 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r520:f474f2b3bee9
Date: 2013-09-06 19:50 +0200
http://bitbucket.org/pypy/stmgc/changeset/f474f2b3bee9/

Log:	Another test that the pushed abort_info objects are kept alive

diff --git a/c4/test/test_extra.py b/c4/test/test_extra.py
--- a/c4/test/test_extra.py
+++ b/c4/test/test_extra.py
@@ -56,21 +56,31 @@
 def test_inspect_abort_info_string():
     fo1 = ffi.new("long[]", [3, HDR + WORD, HDR, 0])
     #
-    @perform_transaction
     def run(retry_counter):
         if retry_counter == 0:
             p = nalloc_refs(2)
+            lib.stm_push_root(p)
             q = nalloc(HDR + 2 * WORD)
+            p = lib.stm_pop_root()
             lib.setptr(p, 1, q)
             lib.setlong(q, 0, 3)
             word = "ABC" + "\xFF" * (WORD - 3)
             lib.setlong(q, 1, struct.unpack("l", word)[0])
             lib.stm_abort_info_push(p, fo1)
+            possibly_collect()
             abort_and_retry()
         else:
+            possibly_collect()
             c = lib.stm_inspect_abort_info()
             assert c
             assert ffi.string(c).endswith("e3:ABCe")
+    #
+    def no_collect():
+        pass
+    for possibly_collect in [no_collect, minor_collect, major_collect]:
+        print '-'*79
+        print 'running with', possibly_collect
+        perform_transaction(run)
 
 def test_inspect_null():
     fo1 = ffi.new("long[]", [3, HDR, HDR + 1, 0])


More information about the pypy-commit mailing list