Date: Wed, 15 Dec 1999 14:51:22 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Martin Ambuhl cc: djgpp AT delorie DOT com Subject: Re: is 'ld --wrap' not for C++? In-Reply-To: <385767A2.18A4FAAD@earthlink.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.