For example we might partition the block sizes by

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: If the placement policy tends to produce good fits, then some additional internal fragmentation might be acceptable. However, if the fit is not good, then the allocator will usually opt to split the free block into two parts. The first 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 find a fit 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 sufficiently large block, or if the free blocks are already maximally coalesced, then the allocator asks the kerne...
View Full Document

Ask a homework question - tutors are online