Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • rtoy's avatar
    45380dbb
    First cut at GCing static vectors, including static simple-arrays. · 45380dbb
    rtoy authored
    This is done by a simple mark-and-sweep GC of the static vectors.
    When scavenging the spaces, we mark any static vectors by setting the
    MSB of the header word.  After GC is done, an *after-gc-hooks*
    function finds all of the static vectors that are not marked and frees
    them.  For marked static vectors, we clear the mark bit.
    
    code/array.lisp:
    o Add *STATIC-VECTORS* to keep track of all static vectors that have
      been allocated.
    o Update MAKE-ARRAY
      - to allow generation of static simple unboxed arrays (1D arrays
        without an array header).
      - Push a weak pointer to the static vector onto *STATIC-VECTORS*
    o Add function FREE-STATIC-VECTOR
    o Add function FINALIZE-STATIC-VECTORS to free static vectors when
      they are no longer referenced.
    
    lisp/gencgc.c:
    o Update scavenge to check for static vectors.  If we find a static
      vector, mark the static vector by setting the MSB of the header
      word.
    45380dbb
    History
    First cut at GCing static vectors, including static simple-arrays.
    rtoy authored
    This is done by a simple mark-and-sweep GC of the static vectors.
    When scavenging the spaces, we mark any static vectors by setting the
    MSB of the header word.  After GC is done, an *after-gc-hooks*
    function finds all of the static vectors that are not marked and frees
    them.  For marked static vectors, we clear the mark bit.
    
    code/array.lisp:
    o Add *STATIC-VECTORS* to keep track of all static vectors that have
      been allocated.
    o Update MAKE-ARRAY
      - to allow generation of static simple unboxed arrays (1D arrays
        without an array header).
      - Push a weak pointer to the static vector onto *STATIC-VECTORS*
    o Add function FREE-STATIC-VECTOR
    o Add function FINALIZE-STATIC-VECTORS to free static vectors when
      they are no longer referenced.
    
    lisp/gencgc.c:
    o Update scavenge to check for static vectors.  If we find a static
      vector, mark the static vector by setting the MSB of the header
      word.