[pypy-svn] r74958 - pypy/branch/fast-ctypes/pypy/module/jitffi

getxsick at codespeak.net getxsick at codespeak.net
Mon May 31 02:19:54 CEST 2010


Author: getxsick
Date: Mon May 31 02:19:52 2010
New Revision: 74958

Modified:
   pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py
Log:
use rdynload instead of libffi

Modified: pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py
==============================================================================
--- pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py	(original)
+++ pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py	Mon May 31 02:19:52 2010
@@ -2,7 +2,7 @@
 from pypy.interpreter.error import operationerrfmt
 from pypy.interpreter.gateway import interp2app
 from pypy.interpreter.typedef import TypeDef
-from pypy.rlib import libffi
+from pypy.rlib import rdynload
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.jit.backend.x86.runner import CPU
 from pypy.jit.metainterp.history import LoopToken, BasicFailDescr, BoxInt
@@ -12,7 +12,7 @@
 class W_CDLL(Wrappable):
     def __init__(self, space, name):
         try:
-            self.cdll = libffi.CDLL(name)
+            self.lib = rdynload.dlopen(name)
         except libffi.DLOpenError, e:
             raise operationerrfmt(space.w_OSError, '%s: %s', name,
                                   e.msg or 'unspecified error')
@@ -23,7 +23,7 @@
     def call(self, space, func, a, b):  # XXX temporary fixed number of func args (ints)
                                         # result_type argument?
         try:
-            addr = rffi.cast(lltype.Signed, self.cdll.getaddressindll(func))
+            addr = rffi.cast(lltype.Signed, rdynload.dlsym(self.lib, func))
         except KeyError:
             raise operationerrfmt(space.w_ValueError,
                                   "Cannot find symbol %s", func)



More information about the Pypy-commit mailing list