logoalt Hacker News

alfiedotwtftoday at 6:06 AM1 replyview on HN

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!


Replies

HexDecOctBintoday at 6:43 AM

No modern libc uses (or should use) brk() as the heap. Allocate virtual memory using mmap, VirtualAlloc, etc., and manage your set of heaps.