VC STLport memory leaks

 http://stlport.sourceforge.net/FAQ.shtml

原文

In the default compile of STLport, the node allocator is used to allocate internal memory. The node allocator works by pre-allocating a large chunk of memory and handing out small memory blocks out. The memory chunk is not freed during running an application that uses STLport (i.e. it don't returned to system, There are tools like BoundsChecker, Purify or Valgrind that check for memorytml leaks, for memory that isn't freed when no longer used. These tools may report false memory leaks when one uses STLport's node allocator. The memory chunk is normally freed at application end, but the memory checkers usually report memory leaks before that point. Another memory problem might be reported when you use shared libraries (e.g. DLL, this problem specific for Windows DLL model) that uses STLport internally and are statically link to it. If memory is allocated in a dll and released in an other then the STLport node allocator will keep the released memory for a future use. If you do not use this memory then your application global memory consumtion will grow until the appli crash even if there is no realy memory leak. This is why you should always use a coherent configuration everything in dll or everything in static lib.

大到的意思,google翻译,E文不好

在STLport中的默认编译的节点分配器用来分配内部存储器。节点分配器的工作原理是预分配大块的内存,并派发小内存块。 (也就是说,它不返回到系统的,有喜欢的BoundsChecker工具,净化或Valgrind的检查,对memorytml泄漏,内存不释放不再使用时,没有释放的内存块。当之一使用STLport中的节点分配器,这些工具可能会报告虚假的内存泄漏的内存块,通常在应用程序结束时释放,但的内存跳棋通常报告在该点之前的内存泄漏。另一个内存问题可能会被报道当您使用的共享库(如DLL的时,这个问题特定于Windows的DLL模型)使用STLport中内部和静态链接到它,如果内存分配在一​​个DLL,在其他发布STLport中的节点分配器,将继续为将来使用释放内存。如果你不使用这种内存,那么你的应用程序的全局内存consumtion将增长,直到应用崩溃,即使有没有真正的内存泄漏,这就是为什么你应该总是使用一个连贯的配置都是在DLL或静态库中的一切。有办法来消除伪内存泄漏(因为内存在程序结束释放,泄漏的只是伪的)。 你可以用另一种是在STLport中使用的分配器。

定义宏

_STLP_USE_NEWALLOC enables a simple allocator that uses "new/delete"

_STLP_USE_MALLOC enables a simple allocator that uses "malloc/free

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kmblack1

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值