From owner-freebsd-hackers Sat Feb 24 12:43:12 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 5FAC437B401 for ; Sat, 24 Feb 2001 12:43:09 -0800 (PST) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id VAA56959; Sat, 24 Feb 2001 21:43:01 +0100 (CET) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: seebs@plethora.net (Peter Seebach) Cc: freebsd-hackers@freebsd.org Subject: Re: Setting memory allocators for library functions. References: <200102242037.f1OKbd618343@guild.plethora.net> From: Dag-Erling Smorgrav Date: 24 Feb 2001 21:43:01 +0100 In-Reply-To: seebs@plethora.net's message of "Sat, 24 Feb 2001 14:37:39 -0600" Message-ID: Lines: 28 User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG seebs@plethora.net (Peter Seebach) writes: > In message , Dag-Erling Smorgrav writes: > >Malloc() does not overcommit - the kernel does. Malloc() doesn't know > >and doesn't care. > But it could still probably force the behavior. Barring kernel changes, not easily, and only for single-threaded programs. > > None of these solutions are portable, however; > Well, no, but the sole available definition of "portable" says that it is > "portable" to assume that all the memory malloc can return is really > available. Show me a modern OS (excluding real-time and/or embedded OSes) that makes this guarantee. > > memory overcommit is to write a malloc() wrapper that installs a > > SIGSEGV handler, then tries to dirty the newly allocated memory, and > > fails gracefully if this causes a segfault. > Ugh. Why not just have a flag for memory requests that requires the memory > not to be overcommitted, and set it in "conforming mode"? Read the paragraph that precedes the one you're quoting. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message