1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2011-10-20 13:39:57 +00:00
parent df0200e510
commit 3bdcf7c5e6
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.68 -
==================================
Fix valgrind error reports in free of pool chunks with DEBUG_MEM.
Aling size of structure chunk for fast pool allocator to 8 bytes.
Simplify some pointer operations in dm_free_aux() debug code.
Remove unused dbg_malloc.h file from source tree.

View File

@ -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);
}