From owner-freebsd-current Wed Apr 14 15:46:30 1999 Delivered-To: freebsd-current@freebsd.org Received: from m4.c2.telstra-mm.net.au (m4.c2.telstra-mm.net.au [24.192.3.19]) by hub.freebsd.org (Postfix) with ESMTP id DF319157C5 for ; Wed, 14 Apr 1999 15:46:26 -0700 (PDT) (envelope-from andrew@lake.com.au) Received: from m5.c2.telstra-mm.net.au (m5.c2.telstra-mm.net.au [24.192.3.20]) by m4.c2.telstra-mm.net.au (8.8.6 (PHNE_14041)/8.8.6) with ESMTP id IAA28222 for ; Thu, 15 Apr 1999 08:44:04 +1000 (EST) X-BPC-Relay-Envelope-From: andrew@lake.com.au X-BPC-Relay-Envelope-To: X-BPC-Relay-Sender-Host: m5.c2.telstra-mm.net.au [24.192.3.20] X-BPC-Relay-Info: Message delivered directly. Received: from areilly.bpc-users.org (CPE-24-192-51-95.nsw.bigpond.net.au [24.192.51.95]) by m5.c2.telstra-mm.net.au (8.8.6 (PHNE_14041)/8.8.6) with SMTP id IAA16995 for ; Thu, 15 Apr 1999 08:44:03 +1000 (EST) Received: (qmail 2078 invoked by uid 1000); 14 Apr 1999 22:37:20 -0000 From: "Andrew Reilly" Message-ID: <19990415083720.A1870@reilly.home> Date: Thu, 15 Apr 1999 08:37:20 +1000 To: alk@pobox.com, dcs@newsguy.com Cc: current@FreeBSD.ORG Subject: Re: swap-related problems References: <14100.61923.427423.153188@avalon.east> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <14100.61923.427423.153188@avalon.east>; from Anthony Kimball on Wed, Apr 14, 1999 at 02:55:27PM -0500 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Apr 14, 1999 at 02:55:27PM -0500, Anthony Kimball wrote: > > : > All I want is that a program gets NULL from malloc if there is no memory > : > available. I find that to be a very fundamental thing about malloc. > > : Do you have a solution? We don't. > > Make an sbrk variant which will pre-allocate backing store. > setenv MALLOC_PREALLOCATE > > Not so hard. You could do this yourself, I think, by: 1) create your own backing file of the appropriate size 2) mmap it into your address space 3) tell your own malloc() routine that that's where it should get memory from. Any problems with that? (besides not being the system standard, and the reduction of swapping efficiency caused by going through the file system). -- Andrew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message