This preview shows page 1. Sign up to view the full content.
Unformatted text preview: sion of allocators, we will assume immediate coalescing, but you should be aware that fast allocators often opt for some form of deferred coalescing. 10.9.11 Coalescing with Boundary Tags
How does an allocator implement coalescing? Let us refer to the block we want to free as the current block. Then coalescing the next free block (in memory) is straightforward and efﬁcient. The header of the current block points to the header of the next block, which can be checked to determine if the next block is free. If so, its size is simply added to the size of the current header and the blocks are coalesced in constant time. But how would we coalesce the previous block? Given an implicit free list of blocks with headers, the only option would be to search the entire list, remembering the location of the previous block, until we reached the current block. With an implicit free list, this means that each call to free would require time linear in the size of the heap. Even with more sophisticated free list org...
View Full Document