www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/15/08:47:59

Date: Wed, 15 Dec 1999 14:51:22 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Martin Ambuhl <mambuhl AT earthlink DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: is 'ld --wrap' not for C++?
In-Reply-To: <385767A2.18A4FAAD@earthlink.net>
Message-ID: <Pine.SUN.3.91.991215144817.20509A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 15 Dec 1999, Martin Ambuhl wrote:

> Alexey Zakhlestine wrote:
> > 
> > Well.... astually AFAIK "free" and "malloc" are C-routines.... not C++
> > 
> > In C++ you should use new/delete
> 
> It may be preferable in most cases to use new and delete in C++, that
> first line has an extremely foul taste.

I don't think this is an issue in this case.  malloc should not be used 
in C++ application code, but I'm guesing that new and delete call malloc 
and free internally.  What the user who started this thread was trying to 
do is to wrap malloc and free with user-defined wrappers, to be able to 
watch memory allocation, presumably for debugging.  Thus, the reference 
to malloc and free in this case is justified.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019