[pypy-svn] r77274 - in pypy/branch/jitffi/pypy/rlib: . test

fijal at codespeak.net fijal at codespeak.net
Wed Sep 22 16:40:22 CEST 2010


Author: fijal
Date: Wed Sep 22 16:40:21 2010
New Revision: 77274

Added:
   pypy/branch/jitffi/pypy/rlib/clibffi.py
      - copied, changed from r77159, pypy/branch/jitffi/pypy/rlib/libffi.py
Removed:
   pypy/branch/jitffi/pypy/rlib/libffi.py
Modified:
   pypy/branch/jitffi/pypy/rlib/test/test_libffi.py
Log:
Goal is to split current rlib/libffi into libffi.so specific-part (clibffi)
and interface part. Purpose is to jit stuff. First part - dummy copy and *
import


Copied: pypy/branch/jitffi/pypy/rlib/clibffi.py (from r77159, pypy/branch/jitffi/pypy/rlib/libffi.py)
==============================================================================
--- pypy/branch/jitffi/pypy/rlib/libffi.py	(original)
+++ pypy/branch/jitffi/pypy/rlib/clibffi.py	Wed Sep 22 16:40:21 2010
@@ -467,7 +467,6 @@
         lltype.free(ll_args, flavor='raw')
         check_fficall_result(ffires, self.flags)
 
-
 class FuncPtr(AbstractFuncPtr):
     ll_args = lltype.nullptr(rffi.VOIDPP.TO)
     ll_result = lltype.nullptr(rffi.VOIDP.TO)
@@ -510,7 +509,10 @@
         push_arg_as_ffiptr(self.argtypes[self.pushed_args], value,
                            self.ll_args[self.pushed_args])
         self.pushed_args += 1
-    push_arg._annspecialcase_ = 'specialize:argtype(1)'
+    # XXX this is bad, fix it somehow in the future, but specialize:argtype
+    # doesn't work correctly with mixing non-negative and normal integers
+    push_arg._annenforceargs_ = [None, int]
+    #push_arg._annspecialcase_ = 'specialize:argtype(1)'
     push_arg.oopspec = 'libffi_push_arg(self, value)'
 
     def _check_args(self):
@@ -549,7 +551,7 @@
             self.ll_result = lltype.nullptr(rffi.VOIDP.TO)
         AbstractFuncPtr.__del__(self)
 
-class CDLL:
+class CDLL(object):
     def __init__(self, libname, unload_on_finalization=True):
         """Load the library, or raises DLOpenError."""
         self.unload_on_finalization = unload_on_finalization

Modified: pypy/branch/jitffi/pypy/rlib/test/test_libffi.py
==============================================================================
--- pypy/branch/jitffi/pypy/rlib/test/test_libffi.py	(original)
+++ pypy/branch/jitffi/pypy/rlib/test/test_libffi.py	Wed Sep 22 16:40:21 2010
@@ -27,7 +27,7 @@
         return 'libm.so'
 
 
-class TestLibffi:
+class TestLibffi(object):
     def setup_method(self, meth):
         ALLOCATED.clear()
 



More information about the Pypy-commit mailing list