Re:Removing garbage collection from the Rust language
by pjmlp on Wednesday June 05, 2013 @03:17AM
(#5824153)
Of course they don't, why should they?!
malloc/free are part of the C language runtime, not OS syscalls.
A compiler writer can build the memory allocator on top of what the OS provides as syscalls or take a shortcut and use the C runtime library instead while adding a dependency to it.
I never mentioned malloc/free were syscalls.
No, but a memory allocator is more that "simple wrappers". My point was that OS kernels (Linux/BSDs at least) don't actually provide malloc/free as syscalls, and that you need to implement an allocator in userspace if you want these functions (even if it's a trivial allocator that wastes memory).