## Larceny Note #5: Dumped Heap Images

Lars T Hansen / June 27, 1997

### How to add a named root to a heap

- Go to Rts/globals.cfg, and add the root to the roots section.
- In the same file, change the heap version number ("heap-version", near the top).
- In Compiler/dumpheap.sch, add the root to the "roots" list the correct position.
- In the same file, add code to build-heap-image that adds the global (using heap.global!) to the roots list.
- Nuke all .lop and .fasl files and rebuild all heap images.

The global is now available from C and millicode under the name chosen in globals.cfg, and from Scheme under the name used in the call to heap.global!. For example, the call

        (heap.global! heap 'signals (dump-global! heap 'pending-signals))

associates the global cell known in Scheme as "pending-signals" with the globals slot with the roots name "signals", corresponding (although you can't see that here) to the global name "G_SIGNALS".

$Id: note5-heap.html 87 1998-11-25 14:38:41Z lth $
larceny@ccs.neu.edu