Saturday, April 13, 2013

brk

Older UNIX has its stack and heap in the same data segment.  Heap grows upward from the segment and stack grows downward.  The line demarcating the two was called the break or break point.  In modern UNIX where data segment is its own memory mapping, the end address of the mapping continue to be called break.

A call to brk function set the end address of the segment.  sbrk increment the end of data segment by amount which can be +ve or -ve.

No comments: