News for hackers. Stuff that matters.
Re:The history of Unix's confusing set of low-level ways to ... by kinghajj on Tuesday November 02, 2021 @08:01PM (#29089283)
This brought back memories from college, when I tried to write my own C memory allocator. It was decidedly simple and extremely inefficient (pretty sure it used linked lists...), but after much hacking I did eventually get it to work with some small CLI programs using the LD_PRELOAD trick... but when I tried launching Gimp, the inefficiency quickly became apparent. I think eventually the splash screen did come up, but I never gave it enough time fully to start!

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.

Re:The history of Unix's confusing set of low-level ways to ... by rstuart4133 on Wednesday November 03, 2021 @11:01PM (#29103246)
For what it's worth, in the Linux kernel brk() just calls mmap() to grow the bss segment. So under the hood, just about everything is mmap(), and brk() is shorthand for a mmap() call that operates on a well known pre-existing mmap() area.