[cmucl-imp] Static array support

Lynn Quam quam at AI.SRI.COM
Mon Nov 30 19:08:38 CET 2009


Sounds good to me.  I have been using foreign code to accomplish this 
for many years. The only problem with this implementation is that the 
static arrays must be explicitly reclaimed.

Allegro Common Lisp supports garbage collectable static arrays (and some 
other structures) using the :allocation :lispstatic-reclaimable keyword 
to make-array. 

Raymond Toy wrote:
> Using an idea from Carl and some code from Lynn Quam that he sent many
> years ago, I have checked in support for static arrays.  These look like
> Lisp arrays in just about every way except that GC will not move them. 
> GC will clean them up if they become garbage.  This is done be creating
> the array storage by malloc'ing space.
>
> To create a static array, use make-array with :allocation :static.
>
> Limitations:
>
>     * Since arrays are malloc'ed, the size and number of static arrays
>       is limited to the size of the C heap, which is relatively small.
>     * You are currently prevented from using adjust-array to change the
>       size of the array.  (If the array grows, new malloc'ed space would
>       be needed, and then the address would change, so this is disabled.)
>     * Only certain unboxed element types are allowed: strings; 8, 16,
>       and 32 bit integers (signed and unsigned); single and double
>       floats; and complex single and double floats.
>     * You cannot dump a static array.  Well, you can, but the reloaded
>       array is no longer static.  No warning or error is currently issued.
>     * You cannot make a displaced, static array.
>     * You cannot make an adjustable static array.
>
>
> The interface and implementation are still open.  Suggestions welcome on
> the appropriate interface and behavior.  The next snapshot will have
> this feature.
>
> Ray
>
>
>
>   



More information about the cmucl-imp mailing list