gpt4 book ai didi

visual-studio - Visual Studio 有类似 Borland 的 CodeGuard 的东西吗?

转载 作者:行者123 更新时间:2023-12-04 07:11:25 25 4
gpt4 key购买 nike

Visual Studio 中是否有任何内容会像 Codeguard 一样报告内存泄漏?

例如:

Error 00001. 0x300010 (Thread 0x0FA4):
Resource leak: The object (0xC65D84) was never deleted

The object (0x00C65D84) [size: 4 bytes] was created with new
| element2.cpp line 3:
| #include "element2.h"
|
|>CS225::Element2::Element2(int _val) : p_val(new int(_val)) { }
|
| CS225::Element2::Element2(const Element2& rhs)
Call Tree:
0x0040E3A7(=bcc_cg.exe:0x01:00D3A7) element2.cpp#3
0x00409116(=bcc_cg.exe:0x01:008116) element-factory.h#19
0x0040D964(=bcc_cg.exe:0x01:00C964) array.cpp#87
0x00405308(=bcc_cg.exe:0x01:004308) driver.cpp#394
0x004054B5(=bcc_cg.exe:0x01:0044B5) driver.cpp#415
0x00405522(=bcc_cg.exe:0x01:004522) driver.cpp#420

------------------------------------------
Error 00002. 0x300010 (Thread 0x0FA4):
Resource leak: The object (0xC65D58) was never deleted

The object (0x00C65D58) [size: 4 bytes] was created with new
| element2.cpp line 6:
|
| CS225::Element2::Element2(const Element2& rhs)
|> : AbstractElement(), p_val(new int(*rhs.p_val))
| { }
|
Call Tree:
0x0040E4B7(=bcc_cg.exe:0x01:00D4B7) element2.cpp#6
0x0040E652(=bcc_cg.exe:0x01:00D652) element2.cpp#26
0x0040D8CD(=bcc_cg.exe:0x01:00C8CD) array.cpp#81
0x00405308(=bcc_cg.exe:0x01:004308) driver.cpp#394
0x004054B5(=bcc_cg.exe:0x01:0044B5) driver.cpp#415
0x00405522(=bcc_cg.exe:0x01:004522) driver.cpp#420

最佳答案

内置,没有。它有 <crtdbg.h >,但它并不像您的示例所暗示的那样全面。有各种附加组件可提供此功能。 Boundschecker 是一种众所周知的流行工具。

关于visual-studio - Visual Studio 有类似 Borland 的 CodeGuard 的东西吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/279173/

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