9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: David Presotto <presotto@closedmind.org>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] making emalloc a library function
Date: Sun,  7 Mar 2004 07:56:04 -0500	[thread overview]
Message-ID: <65d4ef76bf4b837c98e49850e56e5019@plan9.bell-labs.com> (raw)
In-Reply-To: <20040307113209.GA18849@melkki.cs.Helsinki.FI>

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

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.

[-- Attachment #2: Type: message/rfc822, Size: 3023 bytes --]

From: Einar Karttunen <ekarttun@cs.helsinki.fi>
To: Plan9 ML <9fans@cse.psu.edu>
Subject: [9fans] making emalloc a library function
Date: Sun, 7 Mar 2004 13:32:09 +0200
Message-ID: <20040307113209.GA18849@melkki.cs.Helsinki.FI>

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

  reply	other threads:[~2004-03-07 12:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-07 11:32 Einar Karttunen
2004-03-07 12:56 ` David Presotto [this message]
2004-03-07 15:37 ` andrey mirtchovski
2004-03-07 17:06   ` Rob Pike
2004-03-07 17:25     ` Einar Karttunen
2004-03-07 16:47       ` andrey mirtchovski
2004-03-07 23:05         ` Geoff Collyer
2004-03-07 23:10           ` boyd, rounin
2004-03-08 10:26             ` Douglas A. Gwyn
2004-03-07 18:45       ` 9nut
2004-03-07 18:48     ` 9nut
2004-03-07 19:39     ` boyd, rounin
2004-03-07 19:34   ` boyd, rounin
2004-03-08 10:25 ` Douglas A. Gwyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65d4ef76bf4b837c98e49850e56e5019@plan9.bell-labs.com \
    --to=presotto@closedmind.org \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).