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

Antoine Allombert antoine.allombert at labri.fr
Wed Jun 25 15:21:24 UTC 2008


Luís Oliveira a écrit :
> Hello,
>
> On Wed, Jun 25, 2008 at 4:09 PM, Antoine Allombert
> <antoine.allombert at labri.fr> wrote:
>   
>>> (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))))
>>     
>
> You've allocated 2 bytes and then referenced 2 ints (8 bytes
> probably). Try (with-foreign-object (ptr :int 2) ...).
>
> HTH.
>
>   
It gives the same result.

I evaluated my form on other machines with good result but I was
unable to find the difference between the systems (same LW, same cffi).
That's why I am asking about the use by cffi of local libraries or files.



More information about the cffi-devel mailing list