diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2011-10-20 13:39:57 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2011-10-20 13:39:57 +0000 |
commit | 3bdcf7c5e6548b40e00c175d0d5b48c0bddbba53 (patch) | |
tree | 2a87f8409954c3db4a34405e148aff8b52dbc6d2 /libdm | |
parent | df0200e5109b0fccacfcefa30c7b954de3c68fa3 (diff) | |
download | lvm2-3bdcf7c5e6548b40e00c175d0d5b48c0bddbba53.tar.gz lvm2-3bdcf7c5e6548b40e00c175d0d5b48c0bddbba53.tar.xz lvm2-3bdcf7c5e6548b40e00c175d0d5b48c0bddbba53.zip |
Mark chunk memory for free as defined again for valgrind
When DEBUG_MEM is used, the memory is trashed with extra pattern before real
free() is called, and as this memory was marked as non accessible when used with
valgrind, make it again usable.
Diffstat (limited to 'libdm')
-rw-r--r-- | libdm/mm/pool-fast.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libdm/mm/pool-fast.c b/libdm/mm/pool-fast.c index 38677619..e14d073c 100644 --- a/libdm/mm/pool-fast.c +++ b/libdm/mm/pool-fast.c @@ -300,6 +300,12 @@ static struct chunk *_new_chunk(struct dm_pool *p, size_t s) static void _free_chunk(struct chunk *c) { +#ifdef VALGRIND_POOL +# ifdef DEBUG_MEM + if (c) + VALGRIND_MAKE_MEM_UNDEFINED(c + 1, c->end - (char *) (c + 1)); +# endif +#endif dm_free(c); } |