Michael G Schwern <[EMAIL PROTECTED]> wrote:
> To catch memory mistakes in C, I'd normally use something like Electric
> Fence or other malloc replacement.  Basically something that replaces the
> memory allocation functions with those that put in magic so that if your
> program walks outside its allocated memory space it immediately pukes.

Recently, I searched the Web for the best C/C++ memory checking tools.
After finding an awful lot of crappy ones, I finally stumbled on mpatrol,
which I like a lot: it is powerful, mature, portable, works with both
C and C++, nice licensing, good quality code and documentation, ...
However, there is quite a long learning curve and you may need to
recompile for best results.

The other standout tool I noticed is valgrind (Linux only, I think): it's
powerful and very easy to use (not requiring recompilation or relinking).
It is a pest though if you want to check setuid executables and it won't
find all memory errors (overwriting a stack array, for instance) -- but
it does find a lot and is really convenient to use.

If anyone knows of other good memory checking tools, please let me know.

/-\


http://greetings.yahoo.com.au - Yahoo! Greetings
Send your love online with Yahoo! Greetings - FREE!

Reply via email to