Due Wednesday, November 6
Identifying the roots
In this lab, you are to implement the print_roots() function described
in Program 6. In this lab, I will assume
you have a system that is at least up to the 20 point level of Program
6; that is, you must have a system capable of giving out memory, and
tracking which memory has been given out. For this lab, you do not
need to have the ability to reclaim memory via either garbage
collection or explicit calls to gc_free(), nor do you need to be able
to coalesce adjacent free chunks of memory.
- 10 points will be awarded for finding the bottom of the stack.
- 90 points will be awarded for finding which segments of your heap
are roots, and printing the pointers associated with those segments
of the heap.
In addition, remember, you may lose points if your program is not
properly structured or adequately documented. Coding guidelines are
given on the
I debated whether or not I should include coalescing in this lab or
not, and in the end decided not to. For students who finish early,
figuring out how to coalesce adjacent chunks of unused memory is an
excellent next step.