[pypy-commit] pypy stacklet: Add an assert in replacement of the previously-explicit

arigo noreply at buildbot.pypy.org
Mon Aug 8 18:16:35 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: stacklet
Changeset: r46381:ceb960318243
Date: 2011-08-08 18:18 +0200
http://bitbucket.org/pypy/pypy/changeset/ceb960318243/

Log:	Add an assert in replacement of the previously-explicit special-
	casing of OS_LIBFFI_CALL. Also explain that this
	has_random_consequences_on_gc_objects=True is not really needed for
	now. Note that forcing it to False makes the assert fail, as
	expected (but a bit hard to test for).

diff --git a/pypy/jit/codewriter/effectinfo.py b/pypy/jit/codewriter/effectinfo.py
--- a/pypy/jit/codewriter/effectinfo.py
+++ b/pypy/jit/codewriter/effectinfo.py
@@ -108,6 +108,10 @@
         result.has_random_consequences_on_gc_objects = (
             has_random_consequences_on_gc_objects)
         result.oopspecindex = oopspecindex
+        #
+        if oopspecindex == EffectInfo.OS_LIBFFI_CALL:
+            assert has_random_consequences_on_gc_objects
+        #
         cls._cache[key] = result
         return result
 
diff --git a/pypy/rlib/clibffi.py b/pypy/rlib/clibffi.py
--- a/pypy/rlib/clibffi.py
+++ b/pypy/rlib/clibffi.py
@@ -305,6 +305,7 @@
 c_ffi_call = external('ffi_call', [FFI_CIFP, rffi.VOIDP, rffi.VOIDP,
                                    VOIDPP], c_ffi_call_return_type,
                       has_random_consequences_on_gc_objects=True)
+                      #^^^ but should be automatic for now: it releases the GIL
 CALLBACK_TP = rffi.CCallback([FFI_CIFP, rffi.VOIDP, rffi.VOIDPP, rffi.VOIDP],
                              lltype.Void)
 c_ffi_prep_closure = external('ffi_prep_closure', [FFI_CLOSUREP, FFI_CIFP,


More information about the pypy-commit mailing list