# Fast Allocation and Deallocation with an Improved Buddy System

## Gerth Stølting Brodal, Erik D. Demaine, and J. Ian Munro

In Acta Informatica, volume 41(4-5), pages 273-291, 2005.

## Abstract

We propose several modifications to the binary buddy system for managing dynamic allocation of memory blocks whose sizes are powers of two. The standard buddy system allocates and deallocates blocks in Θ(lg n) time in the worst case (and on an amortized basis), where n is the size of the memory. We present three schemes that improve the running time to O(1) time, where the time bound for deallocation is amortized for the first two schemes. The first scheme uses just one more word of memory than the standard buddy system, but may result in greater fragmentation than necessary. The second and third schemes have essentially the same fragmentation as the standard buddy system, and use O(2(1 + \sqrt{lg n}) lg lg n) bits of auxiliary storage, which is ω(lgk n) but o(n^ε) for all k ≥ 1 and ε > 0. Finally, we present simulation results estimating the effect of the excess fragmentation in the first scheme.

Online version

actainformatica05.pdf (212 Kb)

DOI

10.1007/s00236-004-0159-6

BIBTEX entry

@article{actainformatica05,
author = "Gerth St{\o}lting Brodal and Erik D. Demaine and J. Ian Munro",
doi = "10.1007/s00236-004-0159-6",
issn = "0001-5903",
journal = "Acta Informatica",
number = "4-5",
pages = "273-291",
title = "Fast Allocation and Deallocation with an Improved Buddy System",
volume = "41",
year = "2005"
}


Other versions