[cffi-devel] strange behaviour of CFFI with LW on OS X

Antoine Allombert antoine.allombert at labri.fr
Wed Jun 25 15:09:26 UTC 2008


Hello everybody,
I face a weird situation with LW and CFFI on OS X 10.4.

When I evaluate the form :

 > (cffi:with-foreign-pointer (ptr 2)
           (setf (cffi:mem-ref ptr :int 0) 0)
           (setf (cffi:mem-ref ptr :int 1) 1)
           (let ((i 0))
           (loop for i from 0 below 2
           collect (cffi:mem-ref ptr :int i))))


The result is :

(256 1)

The first value of the pointer has been turned from 0 to 256.

I tried other similar tests using explicit "foreign-alloc" with similar 
results.

Note that in each case, the last modified place of the pointer keeps his 
right
value while the value of the other places of the pointer are changed.

I use the correct package. So I am wondering if it could be a problem
in my system.

Any idea or ptoposition welcome.

Regards.





More information about the cffi-devel mailing list