Jan-Jaap van der Geer wrote:
John Tytgat <[EMAIL PROTECTED]> wrote:

In message <[EMAIL PROTECTED]>
          Jan-Jaap van der Geer <[EMAIL PROTECTED]> wrote:

I am trying to find an irritating heisenbug in my code.
Sometimes my C++ program exits with malloc errors. The strange
thing is that I do not use malloc in my code, except for one
place, where I do use it. However, when it fails it should not
be anywhere near that code.

So I wonder if C++ / GCC internally use malloc to implement "new"
and stuff like that. Does anyone know?

Yes, that's certainly the case. E.g. for the GCCSDK 3.4.6 code
base:
<URL:http://www.riscos.info/websvn/filedetails.php?repname=gccsdk&path=%2Fbranches%2Frelease_3_4_6%2Fgcc%2Fgcc%2Flibstdc%2Flibsupc%2Fnew_op.cc&rev=0&sc=0>
& other flavors of 'operator new'.

Thanks. Good to know.

Strictly speaking, libstdc++ makes use of malloc for 'new'.  This is
almost always true in C++, except in some very unusual setups - GCC
itself doesn't know much about it except for syntax reasons.  libstdc++
might also use malloc internally, although I suspect not.  UnixLib
also uses malloc internally for various uses - mostly for some
initialisation purposes, but also for some filename conversion
stuff.


_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Reply via email to