FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Moderate update since 8.2 release.
8.1 version

lispval-other-to-address

Arguments: static-array

Allegro CL supports static arrays, where the array is stored in malloc space, which is never moved and untouched by the garbage collector. Such arrays are created with make-array using the Allegro-CL-specific allocation keyword argument, as described in the description of make-array in implementation.htm. See also Static arrays in gc.htm.

This function is useful for freeing a static array (recall, it will not be garbage collected). When called with a static array as its argument, it returns an integer suitable to be the argument to aclfree. The array will be freed when aclfree is called with that integer as its argument. Be sure not to try to access the array after it has been freed in that way, as doing so will return meaningless values. Even worse is storing in this now invalid array. Doing that may overwrite data now used by something else, with potentially disastrous results.

The value returned by this function is not suitable for accessing array values

Do not use the value returned by this function to access elements of the array. Even though the array is not moved once it is created (so the value remains valid regardless of garbage collections), it points to the array header, not the array data. While in theory you could figure out where the data starts given the header location, there is no guarantee that offset will not be changed in some update. Further, changing the array from static allocation to (say) heap allocation will invalidate any accessing code.

Instead you should associate a foreign type to the array (see ftype.htm) and use with fslot-value-typed and fslot-address-typed.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Moderate update since 8.2 release.
8.1 version