Efficient implementation of the first-fit strategy for dynamic storage allocation
- 1 July 1989
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 11 (3) , 388-403
- https://doi.org/10.1145/65979.65981
Abstract
We describe an algorithm that efficiently implements the first-fit strategy for dynamic storage allocation. The algorithm imposes a storage overhead of only one word per allocated block (plus a few percent of the total space used for dynamic storage), and the time required to allocate or free a block is O (log W ), where W is the maximum number of words allocated dynamically. The algorithm is faster than many commonly used algorithms, especially when many small blocks are allocated, and has good worst-case behavior. It is relatively easy to implement and could be used internally by an operating system or to provide run-time support for high-level languages such as Pascal and Ada. A Pascal implementation is given in the Appendix.Keywords
This publication has 11 references indexed in Scilit:
- The software lookaside buffler reduces search overhead with linked listsCommunications of the ACM, 1984
- Tailored-List and Recombination-Delaying Buddy SystemsACM Transactions on Programming Languages and Systems, 1984
- Analysis of free-storage algorithms-visitedIBM Systems Journal, 1984
- The PORT Mathematical Subroutine LibraryACM Transactions on Mathematical Software, 1978
- Anomalous behavior of the fifty-percent rule in dynamic memory allocationCommunications of the ACM, 1977
- Buddy systemsCommunications of the ACM, 1977
- A comparison of next-fit, first-fit, and best-fitCommunications of the ACM, 1977
- Worst case fragmentation of first fit and best fit storage allocation strategiesThe Computer Journal, 1977
- On the external storage fragmentation produced by first-fit and best-fit allocation strategiesCommunications of the ACM, 1975
- A fast storage allocatorCommunications of the ACM, 1965