我只是在测试我正在编写的一些 c 代码,我发现我有很多内存泄漏,所以我想看看它们是从哪里来的。我所有的代码是:
int main() {
return 0;
}
只是一个简单的 main 什么也没做,我有所有这些内存泄漏:
==38882== HEAP SUMMARY:
==38882== in use at exit: 58,678 bytes in 363 blocks
==38882== total heap usage: 514 allocs, 151 frees, 62,544 bytes allocated
==38882==
==38882== LEAK SUMMARY:
==38882== definitely lost: 8,624 bytes in 14 blocks
==38882== indirectly lost: 1,168 bytes in 5 blocks
==38882== possibly lost: 4,925 bytes in 68 blocks
==38882== still reachable: 43,961 bytes in 276 blocks
==38882== suppressed: 0 bytes in 0 blocks
==38882== Rerun with --leak-check=full to see details of leaked memory
==38882==
==38882== For counts of detected and suppressed errors, rerun with: -v
==38882== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
当我在我大学的计算机上运行此代码时,我没有内存泄漏。我的本地机器上是否有什么东西导致了这么多内存泄漏?