public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@dcc.unicamp.br>
To: Carlo Wood <carlo@runaway.xs4all.nl>
Cc: egcs@cygnus.com (egcs@cygnus.com)
Subject: Re: malloc/free & new/delete balance
Date: Tue, 30 Jun 1998 01:02:00 -0000	[thread overview]
Message-ID: <oremw7675f.fsf@iguacu.dcc.unicamp.br> (raw)
In-Reply-To: <199806291141.NAA19053@jolan.ppro>

Carlo Wood <carlo@runaway.xs4all.nl> writes:

> WEAK (void operator delete[] (void *ptr) throw ())
> {
>   if (ptr)
>     free (ptr);
> }

> This unbalance between calling `::operator new(size_t)' and `free(void *)'
> is causing troubles when `operator new(size_t)' and `operator delete(void *)'
> are overloaded

Agreed, but, for some reason, the FDIS [lib.new.delete.array] defines
operator new[](size_t) as returning operator new(size_t) by default,
while it states that operator delete[](void*) frees the pointer it is
given.  So, I'd say the implementation is correct, and calling
operator delete(void*) is non-standard.  Too bad. :-(

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


  reply	other threads:[~1998-06-30  1:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-29  8:41 Carlo Wood
1998-06-30  1:02 ` Alexandre Oliva [this message]
1998-06-30 15:15   ` Carlo Wood
1998-06-30 14:46     ` Alexandre Oliva
1998-06-30 14:46 Sol Foster
1998-07-01 22:54 Mike Stump
1998-07-02  1:39 ` Alexandre Oliva
1998-07-03  7:20 Sol Foster
1998-07-03 19:30 ` Carlo Wood
     [not found] <199807031202.IAA26419.cygnus.egcs@maniac.deathstar.org>
1998-07-05 19:46 ` Nathan Myers
1998-07-06 14:48   ` Joern Rennecke
1998-07-06 18:52     ` John Carr
1998-07-07  1:12       ` Joern Rennecke

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=oremw7675f.fsf@iguacu.dcc.unicamp.br \
    --to=oliva@dcc.unicamp.br \
    --cc=carlo@runaway.xs4all.nl \
    --cc=egcs@cygnus.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).