Visual Leak Detector VS2019

Visual Leak Detector

介绍

(翻译仅供参考)

Visual C++ provides built-in memory leak detection, but its capabilities are minimal at best. This memory leak detector was created as a free alternative to the built-in memory leak detector provided with Visual C++. Here are some of Visual Leak Detector’s features, none of which exist in the built-in detector:

Visual C++提供了内置内存泄漏检测,但其性能很低。这个内存泄漏检测器被创建为用Visual C++提供的内置内存泄漏检测器的免费替代。这里有一些内置检测器中没有的Visual Leak Detector的特点:

  • Provides a complete stack trace for each leaked block, including source file and line number information when available.
  • Detects most, if not all, types of in-process memory leaks including COM-based leaks, and pure Win32 heap-based leaks.
  • Selected modules (DLLs or even the main EXE) can be excluded from leak detection.
  • Provides complete data dumps (in hex and ASCII) of leaked blocks.
  • Customizable memory leak report: can be saved to a file or sent to the debugger and can include a variable level of detail.
  • 为每个泄漏的块提供完整的堆栈跟踪,包括源文件和行号信息(如果可用)。
  • 检测大多数(如果不是全部)进程内内存泄漏类型,包括基于COM的泄漏和纯Win32基于堆的泄漏。
  • 选定的模块(dll甚至主exe)可以从泄漏检测中排除。
  • 提供泄漏块的完整数据转储(十六进制和ASCII格式)。
  • 可自定义的内存泄漏报告:可以保存到文件或发送到调试器,并且可以包含可变详细级别。

Other after-market leak detectors for Visual C++ are already available. But most of the really popular ones, like Purify and BoundsChecker, are very expensive. A few free alternatives exist, but they’re often too intrusive, restrictive, or unreliable. Visual Leak Detector is currently the only freely available memory leak detector for Visual C++ that provides all of the above professional-level features packaged neatly in an easy-to-use library.

Visual C++的其他售后市场泄漏检测器已经可用。但是大多数真正流行的,像Purify和BoundsChecker,都非常昂贵。一些免费的替代品存在,但它们往往过于侵入,限制,或不可靠。Visual Leak Detector是目前(原文可能写于约四年前)唯一可用的Visual C++的内存泄漏检测器,它提供了所有以上的专业级功能,在一个易于使用的库中被打包。

Visual Leak Detector is licensed free of charge as a service to the Windows developer community. If you find it to be useful and would like to just say “Thanks!”, or you think it stinks and would like to say “This thing sucks!”, please feel free to drop us a note. Or, if you’d prefer, you can contribute a small donation. Both are very appreciated.

Visual Leak Detector是免费授权给Windows开发人员社区的服务。如果你觉得它有用,只想说“谢谢!,或者你觉得它很臭,想说“这东西很烂!“,请随时给我们留言。或者,如果你愿意,你可以捐一点钱。两者都非常感谢。

下载安装

Visual Leak Detector VS2019_第1张图片
理论上是供Visual C++ 2008-2015使用,实际上似乎VS2019也能用。

使用

#include 
#include

#include

int main()
{
    std::cout << "begin\n";
    int* a = new int[10]{ 0,1,2,3,4,5,6,7,8,9 };
    std::cout << a << " " << a + 1 << "\n";
    //std::unique_ptr a(new int[10]{ 0,1,2,3,4,5,6,7,8,9 });
    //std::cout << &a[0] << " " << &a[1] << "\n";
    std::cout << "end\n";
    return 0;
}

Visual Leak Detector VS2019_第2张图片
Visual Leak Detector VS2019_第3张图片

Intel采用小端编址,低位低地址,高位高地址。
参考资料:
大端和小端

你可能感兴趣的:(C++,c++,内存泄漏)