Mail Archives: djgpp/1999/12/15/08:47:59
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 -