Computer
Systems

Fall 2020
course
site
-->

malloc lab - bennington.jupyter files

Here's how to get started with the malloclab on jupyter.

# First, get to your jupyter.bennington terminal, and create a folder to work in. Then :
$ wget https://cs.bennington.college/courses/fall2020/systems/code/malloclab/malloclab-bennington.tar
$ tar xvf malloclab-bennington.tar
$ cd malloclab-handout
$ make
$ ./mdriver -v -t . -f short1-bal.rep
$ ./mdriver -v -t . -f short2-bal.rep
$ ./mdriver -v

The task is to implement malloc, free, and realloc, which allocate, free, and resize memory blocks on the heap, using the API in mm.c.

The mm.c provided contains a "naive" somewhat working implementation, which just returns the next block of memory without ever freeing anything.

The mdriver program runs trace files that exercise the program, asking for different amounts of memory, and measuring how quickly the program can provide them.

The short1-bal.rep and short2-bal.rep trace files give easy tests, provided for debugging. When running them, the -t . option means "look for a trace file in this folder".

The config.h file defines a location for some default traces which I've put into /home/mahoney/malloc_traces/ ; those are what's run when you just type ./mdriver -v. On the naive implementation, some of those tests run out of memory.

https://cs.bennington.college /courses /fall2020 /systems /code /malloclab /home
last modified Fri December 4 2020 12:45 pm