为什么一个简单的std :: deque <int>在退出时不释放所有内存?

时间:2017-01-27 17:00:25

标签: c++ linux valgrind

以下代码

#include <deque>
int main() {
  std::deque<int> Q;
  return 0;
}

根据valgrind生成一个非干净的出口:

==9942== HEAP SUMMARY:
==9942==     in use at exit: 72,704 bytes in 1 blocks
==9942==   total heap usage: 3 allocs, 2 frees, 73,280 bytes allocated
==9942== 
==9942== LEAK SUMMARY:
==9942==    definitely lost: 0 bytes in 0 blocks
==9942==    indirectly lost: 0 bytes in 0 blocks
==9942==      possibly lost: 0 bytes in 0 blocks
==9942==    still reachable: 72,704 bytes in 1 blocks
==9942==         suppressed: 0 bytes in 0 blocks

在Linux Mint上用g ++编译的代码。

这是标准库中的错误吗?

有没有办法让干净的退出?

更改为&#34; new / delete&#34;方法只报告4个分配和3个释放......

0 个答案:

没有答案