1
==1581== 
==1581== HEAP SUMMARY:
==1581==     in use at exit: 49,152 bytes in 3 blocks
==1581==   total heap usage: 4 allocs, 1 frees, 50,176 bytes allocated
==1581== 
==1581== LEAK SUMMARY:
==1581==    definitely lost: 0 bytes in 0 blocks
==1581==    indirectly lost: 0 bytes in 0 blocks
==1581==      possibly lost: 0 bytes in 0 blocks
==1581==    still reachable: 49,152 bytes in 3 blocks
==1581==         suppressed: 0 bytes in 0 blocks
==1581== Reachable blocks (those to which a pointer was found) are not shown.
==1581== To see them, rerun with: --leak-check=full --show-reachable=yes
==1581== 
==1581== For counts of detected and suppressed errors, rerun with: -v
==1581== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
Killed
4

1 回答 1

0

一些分配的块在执行检查时理论上仍然有效。也许稍后会处理静态或全局数据。或者比应用程序代码更长寿的 C++ 标准流(从不破坏)。

这里有一个提示:

==1581== 未显示可达块(找到指针的块)。
==1581==要查看它们,请重新运行:--leak-check=full --show-reachable=yes

于 2012-04-28T11:30:26.770 回答