Programming Assignment 3
Memory Management

Due on Wednesday April 13 before midnight


Modify the following C program:


so that it does memory management using a free list. The buffer vector contains list cells, which reference other list cells in the buffer using pointers. All garbage cells should be linked into the free_list. When you need to construct a new list cell, you should get it from the free_list. When you free a list cell, you should put it back in the free_list. Initially, the free_list should contain all the cells in the buffer. Your task is to complete the code (put code in the functions: initialize, my_malloc, and my_free) so that it uses the free list to do memory management. You should not use the malloc or free functions in C. See pages 60-61 in l05.pdf.

What to Submit

Use the form below to submit your programming assignment. We do not accept email or hardcopy submissions. The only acceptable file format for your submitted file is plain text (you source file pa3.c). You may submit your file as many times as you like, but only the most recently submitted file will be retained and evaluated.

Submit Project #3:

Last modified: 04/04/11 by Leonidas Fegaras