[cffi-devel] Re: cffi-manual - continuation2
Yaroslav Kavenchuk
kavenchuk at jenty.by
Fri Dec 30 13:08:17 UTC 2005
foreign-type-size:
CFFI[56]> (defcstruct foo
(a :double)
(c :char))
FOO
CFFI[57]> (foreign-type-size :double)
8
CFFI[58]> (foreign-type-size :char)
1
CFFI[59]> (foreign-type-size 'foo)
16
;; in example - 12
foreign-alloc:
CFFI[72]> (foreign-alloc :int :initial-contents '(1 2 3))
#<FOREIGN-ADDRESS #x012D54A0>
CFFI[73]> (loop for i from 0 below 3
collect (mem-ref * :int i))
(1 33554432 131072)
CFFI[74]> (foreign-alloc :int :initial-contents #(1 2 3))
#<FOREIGN-ADDRESS #x012D5578>
CFFI[75]> (loop for i from 0 below 3
collect (mem-ref * :int i))
(1 33554432 131072)
Oops?
Thanks!
--
WBR, Yaroslav Kavenchuk.
More information about the cffi-devel
mailing list