gpt4 book ai didi

valgrind allocs 多于 frees 但没有泄漏

转载 作者:行者123 更新时间:2023-12-05 04:18:03 26 4
gpt4 key购买 nike

我遇到了一个问题..当我用我的程序运行 valgrind 时,我得到了以下输出,这让我很困惑:

==12919== HEAP SUMMARY:
==12919== in use at exit: 97,820 bytes in 1 blocks
==12919== total heap usage: 17 allocs, 16 frees, 99,388 bytes allocated
==12919==
==12919== LEAK SUMMARY:
==12919== definitely lost: 0 bytes in 0 blocks
==12919== indirectly lost: 0 bytes in 0 blocks
==12919== possibly lost: 0 bytes in 0 blocks
==12919== still reachable: 97,820 bytes in 1 blocks
==12919== suppressed: 0 bytes in 0 blocks
==12919== Reachable blocks (those to which a pointer was found) are not shown.
==12919== To see them, rerun with: --leak-check=full --show-reachable=yes
==12919==
==12919== For counts of detected and suppressed errors, rerun with: -v
==12919== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)

最佳答案

我发现它是由带有“-pg”标志的编译引起的。没有它一切都好!

关于valgrind allocs 多于 frees 但没有泄漏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18898988/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com