In the last episode (Oct 22), Terry Lambert said:
> Dan Nelson wrote:
> > > The FreeBSD malloc uses anonymous pages mmap'ed off of /dev/zero.
> > >
> > > The Linux malloc uses pages added to the process address space via a
> > > call to sbrk.
> > 
> > Actually, on FreeBSD only the page directory is mmap'ed.  Data
> > returned to the user is allocated via sbrk.
> 
> Please see:
> 
>       /usr/src/lib/libc/stdlib/malloc.c
> 
> The only calls to sbrk have a 0 argument.  This is only used to find
> the segment end, so that the mmap's do not occur over top of anything
> important.

Ah, but take a look at the calls to brk, especially in map_pages() and
free_pages().

-- 
        Dan Nelson
        [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to