调试时内存泄漏

发布于 2025-02-04 11:30:45 字数 219 浏览 0 评论 0原文

我有一个在Visual Studio上在C上写的代码。 当我在调试模式下运行它时,即使我不使用任何Malloc,Calloc或其中一个功能,也不会尝试打开任何文件或目录,也会获得内存泄漏。 当我在发布模式下运行相同的代码时,但是我没有内存泄漏。 我有两个问题:

  1. 两种模式之间的区别实际上是什么区别,
  2. 为什么我只在调试时才会泄漏?有人曾经面临过这个问题吗?我能做什么?

I have a code that I wrote in C on visual studio.
when I run it on debug mode I get memory leaks, even when I don't use any malloc or calloc or one of those functions, and don't attempt to open any file or directory.
when I run the same code on Release mode however I get no memory Leaks.
I have two questions:

  1. what is actually the difference between the two modes
  2. why am I getting leaks only on Debug? has someone ever faced this problem? is there something I can do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文