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库的问题还是?
...全文
1965打赏收藏
boost库中的fast_pool_allocator会导致内存泄露
VS2012下boost_1_55_0 如下方式申明一个变量:std::vector<int, boost::fast_pool_allocator > vec; 不对vec进行任何操作,程序结束后会显示: Detected memory leaks! Dumping objects -> {735} normal block at 0x006E3C30, 264 bytes long. Data: <8<n @ 38 3C 6E 00 00 00 00 00 40 3C 6E
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.
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.
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.
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.