简体   繁体   English

用于检查C泄漏的仪器?

[英]Instruments to check for leaks in C?

I just upgraded to Mac OS X Mountain Lion and found out that valgrind is still not compatible with Mountain Lion. 我刚刚升级到Mac OS X Mountain Lion,发现valgrind仍然与Mountain Lion不兼容。

I have a 600 line C code that I need to check against memory leaks. 我有一个600行C代码,我需要检查内存泄漏。

What are possible ways to do it other than valgrind? 除了valgrind之外,有什么方法可以做到这一点? Can I use Xcode instruments? 我可以使用Xcode乐器吗?

You could check the clang static analyzer . 你可以检查铿锵静态分析仪 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. 它比valgrind更好,因为它进行静态分析而不是运行代码 - 所以它可以找到你很少到达的bug。 However, it is more likely to trigger false positives as well. 但是,它也更有可能引发误报。 And it's not as mature as valgrind. 它并不像valgrind那样成熟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM