| | 4 | |
| | 5 | Files: [[GhcFile(rts/sm/GC.c)]] |
| | 6 | |
| | 7 | Constant Applicative Forms, or CAFs for short, are top-level values defined in a program. |
| | 8 | To avoid memory leaks cause 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. |
| | 9 | |
| | 10 | To achieve this, during GC we maintain a linked list of static objects that are still live. |
| | 11 | Closure that might refer to CAFs contains a Satic Reference Table (SRT) which indicates what |
| | 12 | CAFs are still in use by this closure. |