A garbage collector is a dynamic storage allocator

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ck is free. If we 10.9. DYNAMIC MEMORY ALLOCATION 535 were to store the allocated/free bit of the previous block in one of the excess low-order bits of the current block, then allocated blocks would not need footers, and we could use that extra space for payload. Note however, that free blocks still need footers. Practice Problem 10.7: Determine the minimum block size for each of the following combinations of alignment requirements and block formats. Assumptions: Implicit free list, zero-sized payloads are not allowed, and headers and footers are stored in four-byte words. Alignment Single-word Single-word Double-word Double-word Allocated block Header and footer Header, but no footer Header and footer Header, but no footer Free block Header and footer Header and footer Header and footer Header and footer Minimum block size (bytes) 10.9.12 Putting it Together: Implementing a Simple Allocator Building an allocator is a challenging task. The design space is large, with numerous alternatives for block format, free list format, and placement, splitting, and coalescing policies. Another challenge is that you are often forced to program outside the safe, familiar confines of...
View Full Document

Ask a homework question - tutors are online