97 points · by jaytaylor · 5y ago · 26 comments
My implementation used brk()/sbrk() exclusively, but I thought about re-implementing with mmap(). Hell, maybe I can try to write an allocator in Rust and expose a C-compatible interface.
EDIT: Never mind, the article answers that eventually, it's still used apparently: "I know that GNU libc does use brk() based allocation for programs that only make small allocations, for example /usr/bin/echo."
(The newer hugepage-aware tcmalloc never uses sbrk.)
https://fd.lod.bz/rbil/interrup/dos_kernel/2148.html#sect-29...
https://fd.lod.bz/rbil/interrup/memory/2f4310.html#sect-4815
https://fd.lod.bz/rbil/interrup/memory/673f_cx5145.html#sect...
https://en.wikipedia.org/wiki/DOS_extender#DOS_extenders
Heap: "an untidy collection of objects placed haphazardly on top of each other". Example: "a heap of cardboard boxes"
This makes sense as the Unix Heap is just a space containing a random collection of objects with random sizes.