【C++】template 統合スレ -- STL/Boost/Loki, etc.
■ このスレッドは過去ログ倉庫に格納されています
0228デフォルトの名無しさん
NGNGBoundsCheckerがSTLportのアロケータ(たぶん)みたいなところで
メモリリークを検出してくれます。
#include <iostream>
#include <string>
int main(int argc, char* argv[])
{
std::string hello = "Hello, world!";
std::cout << hello << std::endl;
return 0;
}
こんなコードでも1600バイトのリークが検出されます。
_STLP_USE_NEWALLOCマクロを使えば出なくなるんですが、遅くなりそうだなー
ってのと、Configuration Manualに
When using tools like Purify (c), Codeguard (c) or BoundsChecker (c),
it is advised to #define _STLP_USE_MALLOC or _STLP_USE_NEWALLOC,
otherwise pointer checking will generally not be available on most STL
internal structures, thus defeating the purpose of those tools.
とあるので気にしなくていいってことなんでしょうか?
■ このスレッドは過去ログ倉庫に格納されています