There is a much better discussion of this in vol. I of Knuth. (Amusingly, in the original edition Knuth uses a simple algorithm (linking the allocated spaces) in the text and leaves the better algorithm (linking the free spaces) to an exercise. In Unix V6 (yes, this really dates me), the "malloc" in the C library used the simple algorithm from Knuth, variable names and all, causing O(N^2) performance problems.)
Re: A quick tutorial on implementing C memory management functions
#21Fascinating---do you have a pointer to the story or some discriminating keywords?