TWiki> CS361fall13 Web>Homework3 (revision 2)EditAttach

Homework 3: a garbage collector for C

In this homework, we build a basic, conservative garbage collector for C programs. Starting from the set of root pointers present in the stack and global variables, we traverse the "object graph" (in the case of malloc, a chunk graph) to find all chunks reachable from the root. These are marked using the third lowest order bit in the size field of each chunk.

Your template provides supporting code for finding the limits of the global variable area in memory, as well as for the stack and heap areas. It also demonstrates very basic marking and sweeping. Your task is to complete the garbage collector, so that it frees all garbage, and leaves every other chunk intact.

To compile the template, type "make", and run it with ./hw3.

Turn-in requirements

For full points, your program should pass all tests in main.c. As in previous homeworks, export the hw3 template to your turn-in directory, add it and commit.

Make all your changes to hw3.c.

Edit | Attach | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2013-09-09 - 22:18:58 - Main.jakob
 
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF