From owner-freebsd-hackers Tue Oct 22 12:46:30 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D21737B41E for ; Tue, 22 Oct 2002 12:46:29 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CEF343E75 for ; Tue, 22 Oct 2002 12:46:28 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.5) id g9MJkCE4013232; Tue, 22 Oct 2002 14:46:12 -0500 (CDT) (envelope-from dan) Date: Tue, 22 Oct 2002 14:46:12 -0500 From: Dan Nelson To: Terry Lambert Cc: Danny Braniss , Poul-Henning Kamp , freebsd-hackers@FreeBSD.ORG Subject: Re: malloc Message-ID: <20021022194612.GA7165@dan.emsphone.com> References: <3DB50A5A.F87EDA78@mindspring.com> <20021022153347.GA92973@dan.emsphone.com> <3DB5A73C.20513D50@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DB5A73C.20513D50@mindspring.com> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message