표준 : : 문자열과 Valgrind의 문제 :C++의 std :: string 풀, 디버그 빌드? 이와 같은 내가 표준 : : 문자열에서 가능한 메모리 누수에 대해 많은 Valgrind의 경고에 문제가
120 bytes in 4 blocks are possibly lost in loss record 4,192 of 4,687
at 0x4A06819: operator new(unsigned long) (vg_replace_malloc.c:230)
by 0x383B89B8B0: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.8)
by 0x383B89C3B4: (within /usr/lib64/libstdc++.so.6.0.8)
by 0x383B89C4A9: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.8)
궁금 해요 :
- 가하는 std :: string (GCC 4.1.2)는 메모리 풀을 사용합니까?
- 그렇다면 디버그 빌드 등의 형태로 풀을 비활성화하는 방법이 있습니까?
아니요, exit()가 없습니다. 수영장이 없으면 왜 메모리가 손실 될 수 있습니까? –