34/34
Part 7 of 7 · Follow-upsCheck yourself
Check yourself
6 questions
  1. 1.An arena of 7 units has free runs (0, 3) and (4, 7), half-open, with a live block at unit 3. What does first fit return for a request of 4 units?

  2. 2.The free list is [(0, 4), (8, 12)] and the block (4, 8) is freed. What should the free list be afterwards?

  3. 3.An arena of S units holds k free runs. What does first fit cost per allocation with one slot per unit, and with a free list?

  4. 4.Why does a C allocator never move a live block to merge the free space into one run?

  5. 5.The free list is [(3, 64)]. A request asks for 16 units aligned to 16. What does alloc return, and what is the free list afterwards?

  6. 6.release(owner) runs for start in self.owned[owner]: self.free(start), and free removes each start from self.owned[owner]. What happens when the owner holds two blocks?

Now the problem this lesson builds to: 36 A block allocator for GPU memoryPractice it