public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Pierre Merlin <pierre.merlin@clarus-networks.fr>
To: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] malloc vs. new
Date: Mon, 24 Jun 2002 04:27:00 -0000	[thread overview]
Message-ID: <200206241019.g5OAJtZ26121@service.netline2.fr> (raw)
In-Reply-To: <Pine.LNX.4.44.0206221724340.23249-100000@ruckus.brouhaha.com>

Hi Scott,

On Sunday 23 June 2002 03:03, Scott Dattalo wrote:
> On Sat, 22 Jun 2002, Dan Conti wrote:
> > 1) write your own operator new/new[]/delete/delete[]. tossing the
> > following into some file should work:
>
> I thought about this, but when you overload new and delete the constructor
> is no longer called (actually, that's an assumption on my part). So I'll
> have to add special code to initialize the objects as they're new'd.

I think your assumption is wrong. IIRC, when you call _ new _, it always 
works as follows :
1) allocates memory space, using operator new  
2) initializes the object(s) being created, using the constructor

Pay attention to this distinction between the NOT overloadable new and the 
operator new, which you can redefine at your convenience.

Regards,
Pierre

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

  reply	other threads:[~2002-06-24 10:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-23 14:40 Dan Conti
2002-06-23 14:56 ` Scott Dattalo
2002-06-24  4:27   ` Pierre Merlin [this message]
2002-06-24 13:25 ` Scott Dattalo
2002-06-24 13:27   ` Scott Dattalo
2002-06-24 15:07     ` Gary Thomas
2002-06-24 19:05       ` Scott Dattalo
2002-06-25  2:32         ` Tim Drury
2002-06-25  6:45     ` Kjell Svensson
     [not found]       ` <200206250843.51339.tdrury@siliconmotorsports.com>
2002-06-25 11:12         ` Kjell Svensson
  -- strict thread matches above, loose matches on Subject: below --
2002-06-27  1:48 Koeller, T.
2002-06-26  9:12 Koeller, T.
2002-06-26  3:38 Koeller, T.
2002-06-26  8:57 ` Tim Drury
2002-06-25  4:51 Koeller, T.
2002-06-25  7:00 ` Tim Drury
2002-06-25 11:20 ` Daniel Leu
2002-06-25 23:38 ` Tim Drury
2002-06-21 20:02 Scott Dattalo

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=200206241019.g5OAJtZ26121@service.netline2.fr \
    --to=pierre.merlin@clarus-networks.fr \
    --cc=ecos-discuss@sources.redhat.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).