25 Jun
2008
25 Jun
'08
3:14 p.m.
Hello, On Wed, Jun 25, 2008 at 4:09 PM, Antoine Allombert <antoine.allombert@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. -- Luís Oliveira http://student.dei.uc.pt/~lmoliv/