Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Writing a Dynamic Storage Allocator
1 Introduction
In this lab you will be writing a general purpose dynamic storage allocator for C programs; that is, your
own version of the malloc, free, realloc, and calloc functions. You are encouraged to explore the
design space creatively and implement an allocator that is correct, efficient, and fast.
2 A Note
This lab features a wide design space; feel free to be creative during this lab. In order to get the most out
of this lab, we strongly encourage you to start early. The total time you spend designing and debugging can
easily eclipse the time you spend coding.
Bugs can be especially pernicious and difficult to track down in an allocator, and you will probably spend a
significant amount of time debugging your code.
3 Logistics
This is an individual project. You should do this lab on one of the ics machines.
4 Hand Out Instructions
Start by downloading malloclab-handout.tar from Autolab to a protected directory in which you
plan to do your work. Then give the command tar xvf malloclab-handout.tar. This will cause
a number of files to be unpacked into the directory.
The only file you will be modifying and turning in is mm.c, which contains your solution. The mdriver.c
program is a driver program that allows you to locally evaluate the performance of your solution in the same
way that Autolab will evaluate your final submission. Use the command make to generate the driver code,
and run it with the command ./mdriver.