All Manuals > Foreign Language Interface User Guide and Reference Manual > 7 Function, Macro and Variable Reference

pointer-element-size Function

Summary

Returns the size in bytes of a foreign object or a foreign type.

Package

fli

Signature

pointer-element-size pointer-or-type => size

Arguments
pointer-or-type
A FLI pointer to a foreign object or the name of a FLI pointer type.
Values
size
A non-negative integer.
Description

The function pointer-element-size returns the size, in bytes, of the object or type specified.

If pointer-or-type is an FLI pointer, size is the size, in bytes, of the object pointed to by pointer-or-type.

If pointer-or-type is the name of a FLI pointer type, size is the size, in bytes, of the elements of that type.

Examples

In the following example a pointer to an integer is created. Then the size in bytes of the integer is returned using pointer-element-size.

(setq point (fli:allocate-foreign-object :type :int))
(fli:pointer-element-size point)
See also

3.2 Pointer testing functions
pointer-element-type
size-of


Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:58