9. Exercises

Exercises from the book using malloc.py:

1. First run with the flags -n 10 -H 0 -p BEST -s 0 to generate a few random allocations and frees. Can you predict what alloc()/free() will return? Can you guess the state of the free list after each request? What do you notice about the free list over time?

2. How are the results different when using a WORST fit policy to search the free list (-p WORST)? What changes?

3. What about when using FIRST fit (-p FIRST)? What speeds up when you use first fit?