#Lab 7 Memory Allocator
This lab requires not only correctness but both space and time performance.
Most of the code are the same as what CMU teachers demonstrated in their book, and it really count that you unsdertand every line of the code.
Only use segregated free list is enough to get a good score
You can also use some datastructure like AVL / RB Tree
Debug is difficult in this lab.
- First, you should confirm that there is no bugs in your high level design.
- Second, insert
printf()
to see where is wrong. - Alternatively, you can use some tools like gdb, or you can read chapter 7 first. In chapter 7, you will find some tricks.
gcc -g
will help you.
It seems that if you use implicit free list, you will get about 60 score.
That means you won't get 0 provided you do work on this lab.
I don't know how much score you will get if using this schema, but will mare than 60.
If you simply use this schema, you will get about 85 score.
- 4 traces will worsen your util.
binary
,binary2
,realloc
,realloc2
. - There are common points in these traces and you can make use of that.
- Common block is
4072
,72
,512
,128
.
You can also use data structures like AVL / RB tree.
Here is a blog from whom got full score CSAPP:lab7
There are some other PPT/PDF you can find on the internet, ics is a common course in many school and if have any question, you can refer to that or ask your assistant.
Performance: 98/100
Final score: [TODO]