Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r59754:08e2e4cd48c6
Date: 2013-01-05 20:23 +0200
http://bitbucket.org/pypy/pypy/changeset/08e2e4cd48c6/

Log:    progress, but still failing

diff --git a/pypy/jit/metainterp/test/test_fficall.py 
b/pypy/jit/metainterp/test/test_fficall.py
--- a/pypy/jit/metainterp/test/test_fficall.py
+++ b/pypy/jit/metainterp/test/test_fficall.py
@@ -113,18 +113,19 @@
                                        ctypes.c_void_p).value)
         math_sin = rffi.cast(rffi.VOIDP, math_sin)
 
+        cd = lltype.malloc(CIF_DESCRIPTION, 1, flavor='raw')
+        cd.abi = clibffi.FFI_DEFAULT_ABI
+        cd.nargs = 1
+        cd.rtype = clibffi.cast_type_to_ffitype(rffi.DOUBLE)
+        atypes = lltype.malloc(clibffi.FFI_TYPE_PP.TO, 1, flavor='raw')
+        atypes[0] = clibffi.cast_type_to_ffitype(rffi.DOUBLE)
+        cd.atypes = atypes
+        cd.exchange_size = 64    # 64 bytes of exchange data
+        cd.exchange_result = 24
+        cd.exchange_result_libffi = 24
+        cd.exchange_args[0] = 16
+
         def f():
-            cd = lltype.malloc(CIF_DESCRIPTION, 1, flavor='raw')
-            cd.abi = clibffi.FFI_DEFAULT_ABI
-            cd.nargs = 1
-            cd.rtype = clibffi.cast_type_to_ffitype(rffi.DOUBLE)
-            atypes = lltype.malloc(clibffi.FFI_TYPE_PP.TO, 1, flavor='raw')
-            atypes[0] = clibffi.cast_type_to_ffitype(rffi.DOUBLE)
-            cd.atypes = atypes
-            cd.exchange_size = 64    # 64 bytes of exchange data
-            cd.exchange_result = 24
-            cd.exchange_result_libffi = 24
-            cd.exchange_args[0] = 16
             #
             jit_ffi_prep_cif(cd)
             #
@@ -136,8 +137,8 @@
             lltype.free(exb, flavor='raw')
             #
             lltype.free(atypes, flavor='raw')
-            lltype.free(cd, flavor='raw')
             return res
             #
         res = self.interp_operations(f, [])
+        lltype.free(cd, flavor='raw')
         assert res == math.sin(1.23)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to