当前位置: 代码迷 >> Rational >> Rational Purify找不到内存泄露,该如何解决
  详细解决方案

Rational Purify找不到内存泄露,该如何解决

热度:3840   发布时间:2013-02-26 00:00:00.0
Rational Purify找不到内存泄露
用vc2003建了一个终端程序

int   main()
{
    char   *p   =   new   char[16];
    return   0;
}

用Purify运行后并没有提示有内存泄露,这是为什么?

------解决方案--------------------------------------------------------
[I] Starting Purify 'd C:\temp\purify\Debug\purify.exe at 2007-05-11 09:20:45
[I] Starting main
[I] Summary of all memory leaks... {16 bytes, 1 block}
[W] MLK: Memory leak of 16 bytes from 1 block allocated in main [purify.exe]
Distribution of leaked blocks
Allocation location
new(UINT) [new.cpp:23]
main [c:\temp\purify\purify.cpp:3]
int main()
{
=> char *p = new char[16];
return 0;
}
mainCRTStartup [crt0.c:206]
[I] Exiting with code 0 (0x00000000)
[I] Program terminated at 2007-05-11 09:20:47
有啊。
  相关解决方案