From owner-freebsd-hackers Tue Oct 22 12:31:32 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 C920637B401 for ; Tue, 22 Oct 2002 12:31:31 -0700 (PDT) Received: from conure.mail.pas.earthlink.net (conure.mail.pas.earthlink.net [207.217.120.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45D7143E3B for ; Tue, 22 Oct 2002 12:31:31 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0482.cvx21-bradley.dialup.earthlink.net ([209.179.193.227] helo=mindspring.com) by conure.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1844kF-0006ne-00; Tue, 22 Oct 2002 12:31:15 -0700 Message-ID: <3DB5A73C.20513D50@mindspring.com> Date: Tue, 22 Oct 2002 12:30:04 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Dan Nelson Cc: Danny Braniss , Poul-Henning Kamp , freebsd-hackers@FreeBSD.ORG Subject: Re: malloc References: <3DB50A5A.F87EDA78@mindspring.com> <20021022153347.GA92973@dan.emsphone.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 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