5 Commits

Author SHA1 Message Date
Philippe Waroquiers
38fab04de9 Clarify name and description/manual for meta mempool
* rename macro VALGRIND_CREATE_META_MEMPOOL
     to VALGRIND_CREATE_MEMPOOL_EXT
* abort execution if a pool is marked as auto_free but is not a meta pool
  + removed test leak-autofreepool-3.vgtest, which now aborts.
* reword/clarify valgrind.h explanations for meta pool
* similarly reword/clarify the manual



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16042
2016-10-15 12:59:04 +00:00
Philippe Waroquiers
7ac00163a3 fix 369468 Remove quadratic metapool alg. using VG_(HT_remove_at_Iter)(VgHashTable *table)
Based on a patch from Ruurd Beerstra
but reworked VG_(HT_remove_at_Iter) so that
the function is implemented without touching the rest of m_hashtable.c
to ensure no performance impact on other hash table usages.

Testing with
for f in 1 2 3 4 5 6 7 8 9; do echo $f;  time ./vg-in-place -q ./memcheck/tests/leak-autofreepool 2 $(expr $f \* 100000); done|&grep user

With the patch :
user	0m0.524s
user	0m0.660s
user	0m0.784s
user	0m0.916s
user	0m1.064s
user	0m1.192s
user	0m1.316s
user	0m1.496s
user	0m1.632s

Without the patch, the same gives:
user	0m4.464s
user	0m16.776s
user	0m24.472s
user	1m5.544s
user	1m21.168s
user	1m40.500s
user	1m54.884s
user	4m58.308s
user	5m34.060s



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16041
2016-10-15 09:30:39 +00:00
Philippe Waroquiers
b53d2291e8 Add an optional 2nd arg to leak-autofreepool to test performance
e.g. using the beloz
for f in 1 2 3 4 5 6 7 8 9; do echo $f;  time ./vg-in-place -q ./memcheck/tests/leak-autofreepool 2 $(expr $f \* 100000); done

This shows that freeing a mempool with significant nr of elements
has a bad effect on performance

Note that no effort has been spent to avoid leaks in this
optional perf test. This is just to analyse the time taken to
free the pool.

The above loop shows that a medium size pool (e.g. < 1000000 elts)
can already take significant time, probably due to the quadratic
algorithm to clear the pool.
Note that the increase can vary a lot, probably depending on the
way the blocks are spread in the hash table: when lucky, the quadratic
algorithm probably somewhat becomes more linear if the elements
are 'properly' ordered in the hash table by deletion order.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15986
2016-09-29 20:04:43 +00:00
Philippe Waroquiers
4a12396ba8 Fix test so that leaked bytes is the same in 32 and 64 bits
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15985
2016-09-25 18:38:19 +00:00
Ivo Raisr
f2b34df721 Added meta mempool support into memcheck for describing a custom allocator which:
- Auto-frees all chunks assuming that destroying a pool destroys all
  objects in the pool
- Uses itself to allocate other memory blocks
Unit tests included.
Fixes BZ#367995
Patch by: Ruurd Beerstra <ruurd.beerstra@infor.com>



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15984
2016-09-24 21:15:44 +00:00