Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 1997 08:17:01 +0200
From:      Poul-Henning Kamp <phk@dk.tfs.com>
To:        David Greenman <dg@root.com>
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/4070: cannot access over 64MB memory 
Message-ID:  <6461.868515421@critter.dk.tfs.com>
In-Reply-To: Your message of "Wed, 09 Jul 1997 15:00:01 PDT." <199707092200.PAA14688@hub.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

>    Malloc is kind of strange when it comes to allocating the virtual address
> space and will consume up to twice the amount requested.

Well, true, but that is not the case here:

The maximum overallocation for any one call to malloc(bytes) is:

	min(pagesize-1, bytes*2-1)

This is because when "bytes" is > pagesize/2, an integral number of
pages is allocated, otherwise a 2^n size chunk is allocated.

--
Poul-Henning Kamp           | phk@FreeBSD.ORG       FreeBSD Core-team.
http://www.freebsd.org/~phk | phk@login.dknet.dk    Private mailbox.
whois: [PHK]                | phk@tfs.com           TRW Financial Systems, Inc.
Power and ignorance is a disgusting cocktail.



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