Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • rtoy's avatar
    7badf899
    Add support for static arrays that are not moved by GC. This is based · 7badf899
    rtoy authored
    on an idea from Carl and Lynn Quam's foreign vector code that he sent
    many years ago.  The static arrays will be GCed if nothing references
    them.
    
    The static arrays are currently limited to strings, 8, 16, and 32-bit
    integers (signed and unsigned), single and double floats, and complex
    single and double floats.  Static arrays are not adjustable because
    adjusting an array can change the address if the array grows.  (Ok
    if the array shrinks, but not implemented.)
    
    To indicate a static array, the data portion of the vector header word
    is set to 1.  It is normally 0 for all other Lisp vectors.
    
    code/array.lisp:
    o Add :ALLOCATION keyword arg to MAKE-ARRAY to allow allocation of
      static vectors.  Do the appropriate thing for static arrays.
    o Add MAKE-STATIC-VECTOR.  This is Lynn's foreign vector stuff
      rewritten in Lisp instead of the original mix of Lisp and C.
    o Add STATIC-ARRAY-P to tell if an array is static or not.
    o Signal errors in MAKE-ARRAY and ADJUST-ARRAY for invalid options
      with static arrays.
    
    code/describe.lisp:
    o Indicate if the array is static.
    
    compiler/fndb.lisp:
    o Tell compiler about new keyword argument, :allocation, for
      MAKE-ARRAY.
    7badf899
    History
    Add support for static arrays that are not moved by GC. This is based
    rtoy authored
    on an idea from Carl and Lynn Quam's foreign vector code that he sent
    many years ago.  The static arrays will be GCed if nothing references
    them.
    
    The static arrays are currently limited to strings, 8, 16, and 32-bit
    integers (signed and unsigned), single and double floats, and complex
    single and double floats.  Static arrays are not adjustable because
    adjusting an array can change the address if the array grows.  (Ok
    if the array shrinks, but not implemented.)
    
    To indicate a static array, the data portion of the vector header word
    is set to 1.  It is normally 0 for all other Lisp vectors.
    
    code/array.lisp:
    o Add :ALLOCATION keyword arg to MAKE-ARRAY to allow allocation of
      static vectors.  Do the appropriate thing for static arrays.
    o Add MAKE-STATIC-VECTOR.  This is Lynn's foreign vector stuff
      rewritten in Lisp instead of the original mix of Lisp and C.
    o Add STATIC-ARRAY-P to tell if an array is static or not.
    o Signal errors in MAKE-ARRAY and ADJUST-ARRAY for invalid options
      with static arrays.
    
    code/describe.lisp:
    o Indicate if the array is static.
    
    compiler/fndb.lisp:
    o Tell compiler about new keyword argument, :allocation, for
      MAKE-ARRAY.