Live data from Hacker News

A quick tutorial on implementing C memory management functions

danluu.com

21–22 of 22 posts

Re: A quick tutorial on implementing C memory management functions

#21
post #4

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.)

Fascinating---do you have a pointer to the story or some discriminating keywords?

Re: A quick tutorial on implementing C memory management functions

#22
post #4

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.)

Fascinating---do you have a pointer to the story or some discriminating keywords?

Here go: http://tech.slashdot.org/comments.pl?sid=26793&cid=2895270
Post reply on HN