且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么 valgrind 在我的“测试"中没有检测到内存泄漏?程序?

更新时间:2023-02-12 12:38:31

发生这种情况的原因是调用:

The reason this happened is that the call to:

valgrind --leak-check=yes test

实际上是在/usr/bin/test 上运行 valgrind,这是一个检查文件类型和比较值的内置程序,我需要的是:

was actually running valgrind on /usr/bin/test which is a built in program that checks file types and compares values, all I needed was:

valgrind --leak-check=yes ./test