This preview shows page 1. Sign up to view the full content.
Unformatted text preview: oc(13) Block size (decimal bytes) Block header (hex) 531 10.9.7 Placing Allocated Blocks
When an application requests a block of bytes, the allocator searches the free list for a free block that is large enough to hold the requested block. The manner in which the allocator performs this search is determined by the placement policy. Some common policies are ﬁrst ﬁt, next ﬁt, and best ﬁt. First ﬁt searches the free list from the beginning and chooses the ﬁrst free block that ﬁts. Next ﬁt is similar to ﬁrst ﬁt, but instead of starting each search at the beginning of the list, it starts each search where the previous search left off. Best ﬁt examines every free block and chooses the free block with the smallest size that ﬁts. An advantage of ﬁrst ﬁt is that it tends to retain large free blocks at the end of the list. A disadvantage is that it tends to leave “splinters” of small free blocks towards the beginning of the list, which will increase the search time for larger blocks. Next ﬁt was ﬁrst proposed by Knuth as an alternative to ﬁrst ﬁt, motivated by the idea that if we found a ﬁt in some free block the last time, there is a good chance that the we will ﬁnd a ﬁt...
View Full Document
- Spring '10
- The American