3 ms·
So much amusing past tense there, given that Linux has a sbrk() function and Glibc cheerfully uses it for small allocations in single-threaded programs. This st
by kazinator 5y ago
So much amusing past tense there, given that Linux has a sbrk() function and Glibc cheerfully uses it for small allocations in single-threaded programs. This stuff is today.
- trasz 5y agoOn Linux. On FreeBSD it’s all ancient history; kernel doesn’t even implement brk() on newer architectures.
- kazinator 5y agoI just found MacOS, Solaris and OpenBSD man pages documenting sbrk and brk.
- trasz 5y agoThere's even a FreeBSD one (https://man.freebsd.org/brk https://man.freebsd.org/brk), which doesn't change the fact that this syscall is not implemented on eg aarch64 and riscv64.
- kazinator 5y agoWell, it doesn't change the fact because it's too busy documenting the fact in the first paragraph. OpenBSD's page calls them "curiosities from before the days of virtual memory management" in the first paragraph, without mentioning that they are missing in any targets. (Still, they are entirely compatible with virtual memory management.)