boost库中的fast_pool_allocator会导致内存泄露

paschen 版主 2015-10-04 06:26:02
VS2012下boost_1_55_0

如下方式申明一个变量:
std::vector<int, boost::fast_pool_allocator<int> > vec;


不对vec进行任何操作,程序结束后会显示:

Detected memory leaks!
Dumping objects ->
{735} normal block at 0x006E3C30, 264 bytes long.
Data: <8<n @<n > 38 3C 6E 00 00 00 00 00 40 3C 6E 00 CD CD CD CD
Object dump complete.

但如果不用boost提供的分配器,写成
std::vector<int> vec;
就不会内存泄露


这难道是boost库的问题还是?
...全文
196 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
iyomumx 2015-10-04
  • 打赏
  • 举报
回复
引用 4 楼 paschen 的回复:
[quote=引用 3 楼 iyomumx 的回复:] [quote=引用 2 楼 paschen 的回复:] [quote=引用 1 楼 iyomumx 的回复:] 文档里有说明啊
引用
The underlying singleton_pool used by the this allocator constructs a pool instance that is never freed. 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.
我没具体研究,也就是要自己释放吗?要怎么写?[/quote] 好像是没法释放的[/quote] 你说的文档是什么?可以发下链接?[/quote] boost目录里的html文档,在线的应该是这个: http://www.boost.org/doc/libs/1_57_0/libs/pool/doc/html/boost/fast_pool_allocator.html
paschen 版主 2015-10-04
  • 打赏
  • 举报
回复
引用 3 楼 iyomumx 的回复:
[quote=引用 2 楼 paschen 的回复:] [quote=引用 1 楼 iyomumx 的回复:] 文档里有说明啊
引用
The underlying singleton_pool used by the this allocator constructs a pool instance that is never freed. 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.
我没具体研究,也就是要自己释放吗?要怎么写?[/quote] 好像是没法释放的[/quote] 你说的文档是什么?可以发下链接?
iyomumx 2015-10-04
  • 打赏
  • 举报
回复
引用 2 楼 paschen 的回复:
[quote=引用 1 楼 iyomumx 的回复:] 文档里有说明啊
引用
The underlying singleton_pool used by the this allocator constructs a pool instance that is never freed. 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.
我没具体研究,也就是要自己释放吗?要怎么写?[/quote] 好像是没法释放的
paschen 版主 2015-10-04
  • 打赏
  • 举报
回复
引用 1 楼 iyomumx 的回复:
文档里有说明啊
引用
The underlying singleton_pool used by the this allocator constructs a pool instance that is never freed. 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.
我没具体研究,也就是要自己释放吗?要怎么写?
iyomumx 2015-10-04
  • 打赏
  • 举报
回复
文档里有说明啊
引用
The underlying singleton_pool used by the this allocator constructs a pool instance that is never freed. 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.
互联网产品经理在向技术部门递交产品策划方案时,除了详尽的需求阐述,一份清晰易懂的产品原型设计方案同样不可或缺。一份出色的原型设计,不仅能促进前期的深入讨论,更能让美工和开发人员更直观地理解产品特性,进而优化工作流程,减少不必要的时间消耗,提升整体工作效率。接下来,我想就产品经理与原型设计之间的关系进行简要的探讨,并期待能与大家进行深入的交流和探讨。 产品原型,简而言之,是产品设计最终成形之前的一个基础框架。对于网站而言,它意味着对页面模块和元素进行初步、大致的排版与布局。进一步讲,我们还加入一些交互性元素,使原型更加具体、生动,更贴近最终产品的形态,从而帮助团队成员更好地理解和构建产品。 很多人存在一个误区,认为UI、UE设计师的职责就是将产品原型转化为具体的页面效果。然而,实际上他们的工作流程是在原型设计完成之后展开的。在整个产品开发流程中,产品经理是最了解产品特性、用户和市场需求的角色。尽管设计师在视觉设计方面可能表现得非常出色,但他们在理解产品、用户、市场及业务方面的深度与准确性上,往往无法与产品经理相提并论。准确地说,设计师的工作是将产品原型转化为产品经理所期望的视觉效果。

64,282

社区成员

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

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