Author: Alex Gaynor <[email protected]>
Branch: numpy-dtype-refactor
Changeset: r49452:eb398ab0ef00
Date: 2011-11-15 18:07 -0500
http://bitbucket.org/pypy/pypy/changeset/eb398ab0ef00/

Log:    Specialize these properly

diff --git a/pypy/rlib/libffi.py b/pypy/rlib/libffi.py
--- a/pypy/rlib/libffi.py
+++ b/pypy/rlib/libffi.py
@@ -411,6 +411,10 @@
     def getaddressindll(self, name):
         return dlsym(self.lib, name)
 
+# These specialize.call_location's should really be specialize.arg(0), however
+# you can't hash a pointer obj, which the specialize machinery wants to do.
+# Given the present usage of these functions, it's good enough.
[email protected]_location()
 @jit.oopspec("libffi_array_getitem(ffitype, width, addr, index, offset)")
 def array_getitem(ffitype, width, addr, index, offset):
     for TYPE, ffitype2 in clibffi.ffitype_map:
@@ -420,6 +424,7 @@
             return rffi.cast(rffi.CArrayPtr(TYPE), addr)[0]
     assert False
 
[email protected]_location()
 @jit.oopspec("libffi_array_setitem(ffitype, width, addr, index, offset, 
value)")
 def array_setitem(ffitype, width, addr, index, offset, value):
     for TYPE, ffitype2 in clibffi.ffitype_map:
@@ -428,4 +433,4 @@
             addr = rffi.ptradd(addr, offset)
             rffi.cast(rffi.CArrayPtr(TYPE), addr)[0] = value
             return
-    assert False
\ No newline at end of file
+    assert False
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to