Comment by alfiedotwtf
2 days ago
Making every C call a system call is not a good idea at all - think about malloc() etc - the OS shouldn’t care about individual allocations and only worry about providing brk() etc. otherwise, performance will die if you’re doing a thousand system calls per second!
No modern libc uses (or should use) brk() as the heap. Allocate virtual memory using mmap, VirtualAlloc, etc., and manage your set of heaps.
I believe glibc uses both mmap and brk depending on the situation.
It is not what I meant and also seems to me not what is meant by sp.h either.