array
is a foreign pointer to a FLI array. Memory can be allocated with:

(fli:allocate-foreign-object

:type :double

:nelems

(ceiling byte-size

(fli:size-of :double)))

to get sufficient alignment for any call to
foreign-typed-aref
.

In the case the memory is allocated by the operating system the best approach is to reference it from Lisp by a pointer type, to avoid making a :c-array foreign type dynamically.

index
should be a valid byte index for
array
. If
index
is declared to be of type
fixnum
then the compiler will optimize it slightly better. Some parts of the FLI (for example, allocate-foreign-object) assume
fixnum
sizes so it is best to use fixnums only.

Notes

Efficient access to a Lisp vector object is also available. See
sys:typed-aref
in the
LispWorks User Guide and Reference Manual
.