From: Crispin F. <cr...@th...> - 2003-05-14 09:39:00
|
Hi, While attempting to locate all the memory in a program that wasn't freed, I came across an odd behaviour. Using the following program: == START == static char * bar = 0; static char * bar1 = 0; void do_stuff1() { bar = new char[1024]; } void do_stuff() { bar1 = new char[1024]; } int main( int argc, char ** argv ) { do_stuff(); do_stuff1(); } == END == (compiled with gcc 3.2.3 (debian unstable), using 'g++ main.cpp-o main' I get only 2 unreachable blocks, but both with the same stacktrace: 2048 bytes in 2 blocks are still reachable in loss record 1 of 1 at 0x4015D573: __builtin_vec_new (vg_clientfuncs.c:161) by 0x4015D5AE: operator new[](unsigned) (vg_clientfuncs.c:174) by 0x8048450: do_stuff() (in /home/crispin/src/tmp/main) by 0x8048470: main (in /home/crispin/src/tmp/main) Surely I should get 2 different stacktraces? Cheers |