Fast allocation and deallocation with an improved buddy system |
| |
Authors: | Gerth Stølting Brodal Erik D Demaine J Ian Munro |
| |
Affiliation: | (1) BRICS, Department of Computer Science, University of Aarhus, IT-Parken, Åbogade 34, 8200 Århus N, Denmark;(2) MIT Computer Science and Artificial Intelligence Laboratory, 32 Vassar Street, MA 02139 Cambridge, USA;(3) School of Computer Science, University of Waterloo, N2L 3G1 Waterloo, Ontario, Canada |
| |
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
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
bits of auxiliary storage, which is
but
for all
and
. Finally, we present simulation results estimating the effect of the excess fragmentation in the first scheme.Received: 4 May 2003, Published online: 22 December 2004Gerth Stølting Brodal: Supported by the Carlsberg Foundation (contract number ANS-0257/20). Partially supported by the Future and Emerging Technologies Programme of the EU under contract number IST-1999-14186 (ALCOM-FT). Basic Research in Computer Science, www.brics.dk, funded by the Danish National Research Foundation.Erik D. Demaine: Partially supported by the Natural Science and Engineering Research Council of Canada (NSERC).J. Ian Munro: Supported by the Natural Science and Engineering Research Council of Canada (NSERC) and the Canada Research Chair in Algorithm Design.This paper includes several results that appeared in preliminary form in the Proceedings of the 19th Conference on the Foundations of Software Technology and Theoretical Computer Science (FST & TCS99) 8]. |
| |
Keywords: | |
本文献已被 SpringerLink 等数据库收录! |
|