From owner-freebsd-amd64@FreeBSD.ORG Mon Jan 26 09:52:40 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 615C416A4CE for ; Mon, 26 Jan 2004 09:52:40 -0800 (PST) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id A27D143D49 for ; Mon, 26 Jan 2004 09:52:37 -0800 (PST) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.10/8.12.3) with ESMTP id i0QHqYaT013250; Mon, 26 Jan 2004 09:52:34 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.10/8.12.3/Submit) id i0QHqYRL013249; Mon, 26 Jan 2004 09:52:34 -0800 Date: Mon, 26 Jan 2004 09:52:34 -0800 From: Brooks Davis To: ml@fruitbat.demon.co.uk Message-ID: <20040126175234.GA28717@Odin.AC.HMC.Edu> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: freebsd-amd64@freebsd.org Subject: Re: malloc() over 4Gb X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2004 17:52:40 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 25, 2004 at 01:37:47PM +0000, ml@fruitbat.demon.co.uk wrote: >=20 > Hi. Could someone clarify whether or not it's possible to malloc() > and mmap() chunks of memory > 4Gb in size using FreeBSD/AMD64 and > that FreeBSD/AMD64 isn't susceptible to the 4Gb process boundary that > 32-bit OSs are restricted by? It works fine (just remember to set your malloc options to aj before mallocing that much memory, it takes a loooong time if you done :-): [9:52am] brooks@brimstone (~): uname -a FreeBSD brimstone 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Tue Jan 6 13:18:20 P= ST 2004 brooks@brimstone:/usr/obj/usr/p4/xname/sys/GENERIC amd64 [9:52am] brooks@brimstone (~): ./a a.out* aeroauth*=20 [9:52am] brooks@brimstone (~): cat foo.c #include #include #include #define GB (1024*1024*1024) int main (int argc, char **argv) { void *foo; printf("Trying to malloc %zd bytes\n", (size_t)7*GB); foo =3D malloc((size_t)7*GB); if (foo !=3D NULL) printf("Success\n"); else printf("failure\n"); } [9:52am] brooks@brimstone (~): gcc -o foo foo.c [9:52am] brooks@brimstone (~): ./foo=20 Trying to malloc 7516192768 bytes Success [9:52am] brooks@brimstone (~):=20 -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFAFVPgXY6L6fI4GtQRAk6nAJwIfYpHrkkP6/u5/O59Asu1u6S5tQCfSCCP iftnuUkE/TiN8sDMFIRk51I= =bNFj -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL--