[pypy-commit] pypy stmgc-c4: test_collect.

arigo noreply at buildbot.pypy.org
Sat Jul 6 21:37:37 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c4
Changeset: r65238:4be9b6ab9ba7
Date: 2013-07-06 16:21 +0200
http://bitbucket.org/pypy/pypy/changeset/4be9b6ab9ba7/

Log:	test_collect.

diff --git a/rpython/translator/c/funcgen.py b/rpython/translator/c/funcgen.py
--- a/rpython/translator/c/funcgen.py
+++ b/rpython/translator/c/funcgen.py
@@ -610,6 +610,8 @@
     OP_STM_ABORT_INFO_PUSH = _OP_STM
     OP_STM_ABORT_INFO_POP = _OP_STM
     OP_STM_INSPECT_ABORT_INFO = _OP_STM
+    OP_STM_MINOR_COLLECT = _OP_STM
+    OP_STM_MAJOR_COLLECT = _OP_STM
 
 
     def OP_PTR_NONZERO(self, op):
diff --git a/rpython/translator/stm/funcgen.py b/rpython/translator/stm/funcgen.py
--- a/rpython/translator/stm/funcgen.py
+++ b/rpython/translator/stm/funcgen.py
@@ -175,6 +175,12 @@
     result = funcgen.expr(op.result)
     return '%s = stm_inspect_abort_info();' % (result,)
 
+def stm_minor_collect(funcgen, op):
+    return 'stm_minor_collect();'
+
+def stm_major_collect(funcgen, op):
+    return 'stm_major_collect();'
+
 
 def op_stm(funcgen, op):
     func = globals()[op.opname]
diff --git a/rpython/translator/stm/test/test_ztranslated.py b/rpython/translator/stm/test/test_ztranslated.py
--- a/rpython/translator/stm/test/test_ztranslated.py
+++ b/rpython/translator/stm/test/test_ztranslated.py
@@ -113,6 +113,15 @@
         cbuilder.cmdexec('')
         # assert did not crash
 
+    def test_collect(self):
+        def entry_point(argv):
+            rgc.collect(int(argv[1]))
+            return 0
+        t, cbuilder = self.compile(entry_point)
+        cbuilder.cmdexec('0')
+        cbuilder.cmdexec('1')
+        # assert did not crash
+
     def test_targetdemo(self):
         t, cbuilder = self.compile(targetdemo2.entry_point)
         data, dataerr = cbuilder.cmdexec('4 5000', err=True)


More information about the pypy-commit mailing list