I am new to UNIX, and I am studying some of UNIX system calls such as brk()
, sbrk()
, and so on....
Last day I have read about malloc()
sbrk()
function increases the programs data segment allocation by specified bytes.
malloc(4096); // sbrk += 4096 Bytes
free(); // freeing memory will not bring down the sbrk by 4096 Bytes
malloc(4096); // malloc'ing again will not increase the sbrk and it will use
the existing space which not result in sbrk() call.