Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2002 12:30:04 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        Danny Braniss <danny@cs.huji.ac.il>, Poul-Henning Kamp <phk@critter.freebsd.dk>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: malloc
Message-ID:  <3DB5A73C.20513D50@mindspring.com>
References:  <E183u5Y-0003Yc-00@cse.cs.huji.ac.il> <3DB50A5A.F87EDA78@mindspring.com> <20021022153347.GA92973@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DB5A73C.20513D50>