Wednesday, 30 January 2013

It is operating system dependent,but on Linux and probably most Unixes

the system call is "sys_brk" which adjusts the size of a process's data segment.

Most mallocs will do this in the same way.

2. To find enough Contiguous space in the Virtual Address Segment to return to

the calling thread.

It is Completely implementation dependent,Linux malloc, tcmalloc and jemalloc (amongst others) will have potentially entirely different approaches. These will trade off speed of allocation against the amount of fragmentation (and therefore unusable address space).