This preview shows page 1. Sign up to view the full content.
Unformatted text preview: If the placement policy tends to produce good ﬁts, then some additional internal fragmentation might be acceptable. However, if the ﬁt is not good, then the allocator will usually opt to split the free block into two parts. The ﬁrst part becomes the allocated block, and the remainder becomes a new free block. Figure 10.39 shows 532 CHAPTER 10. VIRTUAL MEMORY how the allocator might split the eight-word free block in Figure 10.38 to satisfy an application’s request for three words of heap memory. start of heap unused 8/0 16/1 16/1 16/0 16/1 0/1 double word aligned Figure 10.39: Splitting a free block to satisfy a three-word allocation request. Allocated blocks are shaded. Free blocks are unshaded. Headers are labeled with (size (bytes)/allocated bit). 10.9.9 Getting Additional Heap Memory
What happens if the allocator is unable to ﬁnd a ﬁt for the requested block? One option is to try to create some larger free blocks by merging (coalescing) free blocks that are physically adjacent in memory (next section). However, if this does not yield a sufﬁciently large block, or if the free blocks are already maximally coalesced, then the allocator asks the kerne...
View Full Document
- Spring '10
- The American