Re: Compiler switches to ease memory debugging in C++ ?
On 5/1/2012 1:22 PM, mathog wrote:
When looking for memory problems in C programs hooking malloc() (and its
variants) and free() is usually enough to find memory leaks. In C++
memory can be allocated and released by programs which contain none of
these functions (explicitly). Are there any switches in gcc, or in other
C++ compilers, that cause the compiler to route memory manipulation
through these routines, or in some similar way aid in debugging memory
issues?
Compiler switches are off-topic, sorry. AFAICT, debugging memory
allocations is one of the most tedious activities AFA C++ programming is
concerned. And that's why there are third-party libraries that have
prepackaged allocators and other fancy stuff that you can use. There
are quite a few of those 3rd party libs on the market. Of course, their
use is not controlled by compiler switches. I bet that some compilers,
though, have their own allocators in the libs shipped along with the
compiler. You'd have to ask for specific ones, and in the newsgroups
that deal with those compilers, NOT HERE.
V
--
I do not respond to top-posted replies, please don't ask