From: Nicholas N. <n.n...@gm...> - 2009-07-24 19:04:40
|
On Mon, Jul 20, 2009 at 2:13 PM, John Reiser<jr...@bi...> wrote: >> Is this info specific to Linux/glibc? AFAICT sbrk/brk >> isn't even POSIX, which makes it even harder to determine what it >> should do. > > sbrk and brk are not POSIX. However, any system that is a derivative > of *nix has sbrk and brk because there are too many softwares (such > as the Bourne shell) which rely on the traditional memory map > (.text, .data+.bss, stack) and the existence of sbrk/brk. AFAICT on Mac OS X the syscall brk() does not exist. The library function sbrk() does, and it's implemented using the mach trap vm_allocate() which does initialise memory. (I'm not making any kind of argument here, I just thought you'd be interested to hear this.) Nick |