shecc
shecc copied to clipboard
libc: Drop brk in favor of mmap inside malloc/free
At present, malloc was implemented via brk system call, which is obsolete. Most malloc implementations use mmap system call instead. We shall drop the use of brk in favor of mmap while implementing maloc and free.
Check comprehensive list for system calls via https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md#cross_arch-numbers
#define __syscall_mmap 192
#define __syscall_munmap 91