Heise reports from SCO Forum
Posted Aug 19, 2003 16:28 UTC (Tue) by daw
In reply to: Heise reports from SCO Forum
Parent article: Heise reports from SCO Forum
A very similar malloc implementation also appears in Kernighan & Ritchie's "The C Programming Language," arguably the most common computer programming textbook ever. I have the second edition (1988), and the code is on p. 187, but I imagine it's in the first, 1978, edition as well.
K&R's version uses a linked list of structs to store the free pointers, while the ancient unix version uses an array of pointers, but the structure of the code snippet is otherwise the same, and it seems likely to me that it had a common ancestor.
FWIW, "The Design and Implementation of the 4.4BSD Operating System" (McKusick et al., 1996) also has a short discussion of the kernel malloc implmentation (no code), which mentions the "first-fit" algorithm.
to post comments)