This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ocate a block of size ¾ , we ﬁnd the ﬁrst available block of size ¾ , such that Ñ. If , then we are done. Otherwise we recursively split the block in half until . As we perform this splitting, each remaining half (known as a buddy), is placed on the appropriate free list. To free a block of size ¾ , we continue coalescing with the free. When we encounter a allocated buddy, we stop the coalescing. A key fact about buddy systems is that given the address and size of a block, it is easy to compute the address of its buddy. For example, a block of size 32 byes with address xxx...x00000 has its buddy at address xxx...x10000 In other words, the addresses of a block and its buddy differ in exactly one bit position. The major advantage of a buddy system allocator is its fast searching and coalescing. The major disadvantage is that the power-of-two requirement on the block size can cause signiﬁcant internal fragmentation. For this reason, buddy system allocators are not appropriate for general-purpose workloads. However, for certain application-speciﬁc workloads, where...
View Full Document
- Spring '10
- The American