Changes between Version 12 and Version 13 of Commentary/Rts/Storage/CAFs


Ignore:
Timestamp:
Oct 8, 2009 10:08:59 PM (6 years ago)
Author:
diatchki
Comment:

--

Legend:

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

    v12 v13  
    55Files: [[GhcFile(rts/sm/GC.c)]], function scavange_srt in [[GhcFile(rts/sm/Scav.h)]]
    66
    7 Constant Applicative Forms, or CAFs for short, are top-level values defined in a program.
    8 To 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. 
     7Constant Applicative Forms, or CAFs for short, are top-level values defined in a program.
     8Essentially, they are objects that are not allocated dynamically at run-time but, instead,
     9are part of the static data of the program.  Sometimes, a CAF may refer to many values in the heap.  This is why, we need to know when a CAF is never going to be used again by the program, and
     10hence the values to which it refers may be garbage collected.
    911
    10 (???)
    11 To 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.
    12 Closures that might refer to CAFs contain a Static Reference Table (SRT) which indicates what
    13 static objects are still needed.
    1412
    1513== Static Reference Tables ==