<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Courier New, Courier, monospace">There are
a number of subtleties in implementing the "static" arrays. The
Allegro </font></font><font size="-1"><font
face="Courier New, Courier, monospace">:ALLOCATION keyword argument to
MAKE-ARRAY is interpreted as follows (taken from the Allegro 7.0
documentation):</font></font><font size="-1"><font
face="Courier New, Courier, monospace"><br>
<br>
</font></font><code>:static</code> or <code>:malloc</code> <code></code><br>
<blockquote>Allocate the new array in malloc (foreign) space. The array
will never be touched by the garbage collector and must be deallocated
explicitly. Only a restricted number of element types are supported for
static arrays. They are listed below. :malloc and :static are synonyms.<br>
</blockquote>
<code>:static-reclaimable</code> <br>
<blockquote>Allocate the new array data in malloc (foreign) space and
the header in Lisp space. The data will never be touched by the garbage
collector but it will be deallocated when there are no pointers from
Lisp (using a finalization). Only a restricted number of element types
are supported for static arrays. They are listed below. <code></code><br>
<code></code></blockquote>
<code>:lispstatic-reclaimable</code> <br>
<blockquote>Allocate the new array in malloc (foreign) space. The array
will never be touched by the garbage collector until there are no
pointers from Lisp, at which point the whole array will be deallocated
explicitly. Any Lisp type can be contained in the array.<br>
</blockquote>
It is important to note the difference between <code>:static-reclaimable</code>
and <code>:lispstatic-reclaimable</code>. I think that <code>:lispstatic-reclaimable
is what needs to be implemented for CMUCL. </code>An array allocated
as <code>:static-reclaimable</code> cannot be a simple-array in CMUCL
since the array data does not immediately follow the header.
Therefore, it is difficult to compile inline array accesses unless
KERNEL::%WITH-ARRAY-DATA or kernel::%array-data-vector is used to get
the actual data-vector. <br>
<code></code><br>
<br>
Raymond Toy wrote:
<blockquote cite="mid:4B1573AC.1000605@gmail.com" type="cite">
<pre wrap="">Marco Antoniotti wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Dec 1, 2009, at 24:16 , Raymond Toy wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Carl Shapiro wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Mon, Nov 30, 2009 at 7:04 AM, Raymond Toy <a class="moz-txt-link-rfc2396E" href="mailto:toy.raymond@gmail.com"><toy.raymond@gmail.com></a>
wrote:
</pre>
<blockquote type="cite">
<pre wrap="">To create a static array, use make-array with :allocation :static.
</pre>
</blockquote>
<pre wrap="">It would be great if the name :static could be reserved for the static
part of the Lisp heap. The name :malloc is more descriptive and less
ambiguous.
</pre>
</blockquote>
<pre wrap="">Works for me.
</pre>
</blockquote>
<pre wrap="">What about :pinned? (Just suggesting)
</pre>
</blockquote>
<pre wrap=""><!---->Perhaps we can follow Allegro's lead?
<a class="moz-txt-link-rfc2396E" href="http://www.franz.com/support/documentation/current/doc/implementation.htm#cl-make-array-2"><http://www.franz.com/support/documentation/current/doc/implementation.htm#cl-make-array-2></a>
(No particular reason, other than to be somewhat compatible.)
So, our :static/:malloc is the same as Allegro's :static-reclaimable.
We could add make our :static/:malloc the same as Allegro's
:static/:malloc since Allegro requires you to explicitly free such
objects. These objects are the malloc'ed foreign arrays that we now
create. The main difference is that we can't reload such arrays
(currently).
I've already updated the code to use :malloc, but we have plenty of time
before the snapshot to change behavior.
Ray
</pre>
</blockquote>
</body>
</html>