From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <65d4ef76bf4b837c98e49850e56e5019@plan9.bell-labs.com> From: David Presotto To: 9fans@cse.psu.edu Subject: Re: [9fans] making emalloc a library function In-Reply-To: <20040307113209.GA18849@melkki.cs.Helsinki.FI> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-vnyylldjybvwlitcunjuvndpmi" Date: Sun, 7 Mar 2004 07:56:04 -0500 Topicbox-Message-UUID: 1ddc015c-eacd-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-vnyylldjybvwlitcunjuvndpmi Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit If its just a flag, some libraries will start to depend on the behavior and noone will be able to write programs that use the libraries and still can survive running out of memory. I think we should just bite the bullet and add e(malloc,realloc,mallocz) to the library. --upas-vnyylldjybvwlitcunjuvndpmi Content-Type: message/rfc822 Content-Disposition: inline Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Sun Mar 7 06:33:29 EST 2004 Received: from mail.cse.psu.edu ([130.203.4.6]) by plan9; Sun Mar 7 06:33:26 EST 2004 Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 1414D19BCF; Sun, 7 Mar 2004 06:33:17 -0500 (EST) Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.4.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id B660819B92; Sun, 7 Mar 2004 06:33:12 -0500 (EST) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 76C7119BAE; Sun, 7 Mar 2004 06:32:13 -0500 (EST) Received: from mail.cs.helsinki.fi (courier.cs.helsinki.fi [128.214.9.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 32B4F19B92 for <9fans@cse.psu.edu>; Sun, 7 Mar 2004 06:32:12 -0500 (EST) Received: from melkki.cs.helsinki.fi (melkki.cs.helsinki.fi [::ffff:128.214.48.122]) (IDENT: root, AUTH: PLAIN cs-relay, TLS: TLSv1/SSLv3,168bits,DES-CBC3-SHA) by mail.cs.helsinki.fi with esmtp; Sun, 07 Mar 2004 13:32:10 +0200 Received: from melkki.cs.helsinki.fi (localhost [127.0.0.1]) by melkki.cs.helsinki.fi (8.12.8/8.12.8) with ESMTP id i27BW9kZ020651 for <9fans@cse.psu.edu>; Sun, 7 Mar 2004 13:32:09 +0200 Received: (from ekarttun@localhost) by melkki.cs.helsinki.fi (8.12.8/8.12.8/Submit) id i27BW9wb020649 for 9fans@cse.psu.edu; Sun, 7 Mar 2004 13:32:09 +0200 From: Einar Karttunen To: Plan9 ML <9fans@cse.psu.edu> Message-ID: <20040307113209.GA18849@melkki.cs.Helsinki.FI> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: [9fans] making emalloc a library function Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Sun, 7 Mar 2004 13:32:09 +0200 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on psuvax1.cse.psu.edu X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63 X-Spam-Level: Hello Quite many programs define emalloc, which does the same thing. I was thinking of ripping these out and replacing with a library. I have two alternative routes. Either make libemalloc which contains emalloc, estrdup and so on or add a flag which makes libc malloc behave like emalloc. The first way would give programs freedom, but library code would still use raw malloc instead of the emalloc. The second solution would be harder for programs wishing to use both emalloc and malloc (of course this would be still possible), but it would be more general... The changes would break no existing code in either case. Should I go forward with either idea? - Einar Karttunen --upas-vnyylldjybvwlitcunjuvndpmi--