Sort of, the Kernel allocates the process image and loads the process image in (.text, .data and .bss).Warrior wrote:The C runtime lib allocates memory fine and the user actually uses malloc when the need arrises that the runtime library cannot anticipate.
>Program needs memory
>Calls malloc() in C library
>malloc() determines there isn't any memory left and it needs another page
>Triggers Kernel syscall for AllocatePage()/ExpandHeap()/brk()
>Kernel allocates another page, attaches it to the process and returns
>malloc() fulfils the request and returns to the program.
All calls to malloc are made directly by the programmer.