This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ze the heap as a sequence of contiguous allocated and free blocks, as shown in Figure 10.38. start of heap unused 8/0 16/1 32/0 16/1 0/1 doubleword aligned Figure 10.38: Organizing the heap with an implicit free list. Allocated blocks are shaded. Free blocks are unshaded. Headers are labeled with (size (bytes)/allocated bit). We call this organization an implicit free list because the free blocks are linked implicitly by the size ﬁelds in the headers. The allocator can indirectly traverse the entire set of free blocks by traversing all of the blocks in the heap. Notice that we need some kind of specially marked end block, in this example a terminating header with the allocated bit set and a size of zero. (As we will see in Section 10.9.12, setting the allocated bit simpliﬁes the coalescing of free blocks.) The advantage of an implicit free list is simplicity. A signiﬁcant disadvantage is that the cost of any operation, such as placing allocated blocks, that requires a search of the free list...
View Full Document
- Spring '10
- The American