gpt4 book ai didi

c - C中的Valgrind检查是否有泄漏

转载 作者:行者123 更新时间:2023-11-30 20:09:23 24 4
gpt4 key购买 nike

使用 Valgrind 检查是否有泄漏。我在网上找到了这两个命令,但有什么不同?除了这两个命令之外,还有其他更好/正确的 Valgrind 命令吗?

valgrind --leak-check=yes ./program

或者

valgrind --leak-check=full -v ./program

最佳答案

man valgrind

-v, --verbose

Be more verbose. Gives extra information on various aspects of your program, such as: the shared objects loaded, the suppressions used, the progress of the instrumentation and execution engines, and warnings about unusual behaviour. Repeating the option increases the verbosity level.

--leak-check= [default: summary]

When enabled, search for memory leaks when the client program finishes. If set to summary, it says how many leaks occurred. If set to full or yes, each individual leak will be shown in detail and/or counted as an error, as specified by the options --show-leak-kinds and --errors-for-leak-kinds.

关于c - C中的Valgrind检查是否有泄漏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52844227/

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