The function
size-of
returns the size in bytes of the foreign language type named by
type-name
.
The following example shows that the integer type has a size of 4 bytes, and that an array of 10 integers has a size of 40 bytes.
(fli:size-of :int)
(fli:size-of '(:c-array :int 10))
The function
size-of
can also be used to determine the size of a structure.
(fli:define-c-struct POS
(x :int)
(y :int)
(z :int))
(fli:size-of 'POS)