¿Instrumentos para comprobar si hay fugas en C?

I just upgraded to Mac OS X Mountain Lion and found out that valgrind is still not compatible with Mountain Lion.

I have a 600 line C code that I need to check against memory leaks.

What are possible ways to do it other than valgrind? Can I use Xcode instruments?

preguntado el 28 de julio de 12 a las 19:07

Install Linux in a VM and run valgrind there. -

Instruments will work fine for C, as long as you have it setup as an Xcode project. -

Of course... Xcode is yelling at me claiming I have duplicate symbols. When on the command line everything builds perfectly. What do you suggest to do? -

sealiesoftware.com/valgrind Valgrind is available on OSX, but 600 lines of code... I would go with careful tracking of each malloc call. -

It is available on OS X for Lion. It is not compatible with Mountain Lion. The code is pretty complicated. I checked for leaks manually but I want to double check to be completely sure. -

1 Respuestas

Podrías comprobar el analizador estático clang. It's pretty awesome tool for finding bugs in the code.

It's better than valgrind in the fact that it does static analysis rather than running the code — so it can find bugs which you rarely reach. However, it is more likely to trigger false positives as well. And it's not as mature as valgrind.

Respondido 28 Jul 12, 21:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.