Changes between Version 5 and Version 6 of Commentary/Rts/Storage/CAFs


Ignore:
Timestamp:
Oct 8, 2009 6:22:39 PM (6 years ago)
Author:
diatchki
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Rts/Storage/CAFs

    v5 v6  
    88To avoid memory leaks caused by CAFs we need to detect when all values/functions that could potentially refer to a CAF are gone, and so it is safe to deallocate the CAF.   
    99 
     10(???) 
    1011To achieve this, all static objects are linked together with the static link field.  During GC we maintain traverse the static objects to see which are still live. 
    1112Closures that might refer to CAFs contain a Static Reference Table (SRT) which indicates what 
    1213static objects are still needed. 
     14 
     15== Static Reference Tables == 
     16 
     17The info table of various closures may contain information about what static objects are 
     18references by the closure.  This information is stored in two parts: 
     19  1. a static reference table (SRT), which is an array of references to static objects 
     20  2. a bitmask which specifies which of the objects are actually used by the closure. 
     21 
     22There are two different ways to access this information depending on the size of the SRT: 
     23  * "small": if {{{srt_bitmask}}} is a small bitmask, not all 1s, then GET_FUN?_SRT contains the SRT. 
     24  * "large": if {{{srt_bitmask}}} is all 1s, then GET_FUN?_SRT contains a large bitmap, and the actual SRT. 
     25