Previous: Localization, Up: Design Choices and Extensions [Contents][Index]
CMUCL supports static arrays which are arrays that are not moved by
the garbage collector. To create such an array, use the
:allocation
option to make-array
with a value of
:malloc
. These arrays appear as normal Lisp arrays, but are
actually allocated from the C
heap (hence the :malloc
).
Thus, the number and size of such arrays are limited by the available
C
heap.
Also, only certain types of arrays can be allocated. The static array
cannot be adjustable and cannot be displaced to. The array must also
be a simple-array
of one dimension. The element type is also
constrained to be one of the types in
Table 2.3.
(unsigned-byte 8) |
(unsigned-byte 16) |
(unsigned-byte 32) |
(signed-byte 8) |
(signed-byte 16) |
(signed-byte 32) |
single-float |
double-float |
(complex single-float) |
(complex double-float) |
Table 2.3: Allowed element types for static arrays
The arrays are properly handled by GC. GC will not move the arrays, but they will be properly removed up if they become garbage.
Previous: Localization, Up: Design Choices and Extensions [Contents][Index]