boost-fast_pool_allocator内存泄露,怎么破?

雨中的月儿 2014-11-23 07:39:31
先上代码:

list<int, fast_pool_allocator<int> > lst;
int i(3);
lst.push_back(i);


上述代码执行完成之后,在MFC工程中就会报出memory leak。
我查看了一下fast_pool_allcator的hpp说明文档如下:
The underlying singleton_pool used by the this allocator
constructs a pool instance that
<b>is never freed</b>. This means that memory allocated
by the allocator can be still used after main() has
completed, but may mean that some memory checking programs
will complain about leaks.


也就是说,fast_pool_allcator使用的singleton_pool是不会主动调用purge_memory来释放内存资源的,那么,怎么破?

请教高手,我如何自己手工实现内存回收?
...全文
207 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
雨中的月儿 2014-11-24
  • 打赏
  • 举报
回复
等大神来~~~~

64,637

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧