suppose:
1.  vector < vector <int> > op_sequence;
2.  op_sequence = vector < vector <int> >(600, vector <int>(POP, 0));
3.  fill (op_sequence[100].begin(), op_sequence[100].end(), 1);

valgrind-3.3.1 reports (valgrind -v --db-attach=yes --tool=memcheck
--leak-check=full --leak-resolution=high --show-reachable=yes
--num-callers=12 ):
still reachable: 1,363 bytes in 40 blocks
7 blocks are due to #3 and the rest don't pertain.

prior to issuing the valgrind command I set:
export GLIBCPP_FORCE_NEW=1
export GLIBCXX_FORCE_NEW=1
as specified in the valgrind FAQ.

Looking for the standard deallocation technique.
I have tried the following but it did not eliminate the reachable mem:
for (i=0; i<600; i++) {
   op_sequence[i].erase (op_sequence[i].begin(), op_sequence[i].end());
   op_sequence[i].clear ();
}
op_sequence.erase (op_sequence.begin(), op_sequence.end());
op_sequence.clear();

thanks for the feedback,
-e.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to