I read in Advanced Unix Programming (and also in several other books) that Linux malloc()uses the Linux system call sbrk()to request memory from the operating system.
I am looking at glibc code malloc.c, and I can see many mentions sbrk()in the comments, but not mentioned directly in the code.
How / where is it sbrk()referenced / used when it malloc()requests memory from the OS?
(This may be a general misunderstanding as to how system calls are made from the C runtime library. If so, would I be interested to know how they are made?)
source
share