Can I use Xcode instruments to test memory leak of a C++ command line tool?
I tried to do so, and I cannot find a console to use cin
.
However, for a iOS app, there will be a simulator so that we can do something to our program.
Can I use Xcode instruments to test memory leak of a C++ command line tool?
I tried to do so, and I cannot find a console to use cin
.
However, for a iOS app, there will be a simulator so that we can do something to our program.
通过将其添加到命令行的开头来使用该iprofiler
工具(manpage ):
iprofiler -leaks -d $HOME/tmp
($HOME/tmp
您希望在哪里写入结果)。
然后,您可以使用Instruments打开生成的.dtps
包以检查泄漏(或执行的其他 4 个检查中的任何一个)。iprofiler
如果您正在使用,则同时使用andclang
编译(因为不支持)。-O3
-g
clang
-pg