public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/libdm/mm dbg_malloc.c
@ 2011-10-28 20:37 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2011-10-28 20:37 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-28 20:37:31

Modified files:
	libdm/mm       : dbg_malloc.c 

Log message:
	Improve valgrind support when compiled with DEBUG_MEM

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/dbg_malloc.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25

--- LVM2/libdm/mm/dbg_malloc.c	2011/10/20 13:33:41	1.24
+++ LVM2/libdm/mm/dbg_malloc.c	2011/10/28 20:37:31	1.25
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
- * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
  *
  * This file is part of the device-mapper userspace tools.
  *
@@ -15,6 +15,10 @@
 
 #include "dmlib.h"
 
+#ifdef VALGRIND_POOL
+#include "valgrind/memcheck.h"
+#endif
+
 #include <assert.h>
 #include <stdarg.h>
 
@@ -115,7 +119,9 @@
 
 	/* log_debug("Allocated: %u %u %u", nb->id, _mem_stats.blocks_allocated,
 		  _mem_stats.bytes); */
-
+#ifdef VALGRIND_POOL
+	VALGRIND_MAKE_MEM_UNDEFINED(nb + 1, s);
+#endif
 	return nb + 1;
 }
 
@@ -141,7 +147,9 @@
 
 	/* sanity check */
 	assert(mb->magic == p);
-
+#ifdef VALGRIND_POOL
+	VALGRIND_MAKE_MEM_DEFINED(p, mb->length);
+#endif
 	/* check data at the far boundary */
 	ptr = (char *) p + mb->length;
 	for (i = 0; i < sizeof(unsigned long); i++)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* LVM2/libdm/mm dbg_malloc.c
@ 2011-02-08 15:52 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2011-02-08 15:52 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-02-08 15:52:01

Modified files:
	libdm/mm       : dbg_malloc.c 

Log message:
	Revert DEBUG_MEM cleanup commit
	
	As functions compiled within this define are apparently stil part of the public API,
	(though lvm2 code is never using them unless this define is used for compilation),
	keep functions available in the code for now -> revert.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/dbg_malloc.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23

--- LVM2/libdm/mm/dbg_malloc.c	2011/01/28 16:01:32	1.22
+++ LVM2/libdm/mm/dbg_malloc.c	2011/02/08 15:52:00	1.23
@@ -15,8 +15,6 @@
 
 #include "dmlib.h"
 
-#ifdef DEBUG_MEM
-
 #include <assert.h>
 #include <stdarg.h>
 
@@ -251,8 +249,6 @@
 	}
 }
 
-#endif
-
 void *dm_malloc_aux(size_t s, const char *file __attribute__((unused)),
 		    int line __attribute__((unused)))
 {


^ permalink raw reply	[flat|nested] 3+ messages in thread

* LVM2/libdm/mm dbg_malloc.c
@ 2011-01-28 16:01 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2011-01-28 16:01 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-01-28 16:01:32

Modified files:
	libdm/mm       : dbg_malloc.c 

Log message:
	Compile code for memory debuging only with DEBUG_MEM
	
	When it's not in use - do not compile this code.
	Improves lcov code coverage results for this code a lot :)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/dbg_malloc.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22

--- LVM2/libdm/mm/dbg_malloc.c	2010/09/30 21:06:52	1.21
+++ LVM2/libdm/mm/dbg_malloc.c	2011/01/28 16:01:32	1.22
@@ -15,6 +15,8 @@
 
 #include "dmlib.h"
 
+#ifdef DEBUG_MEM
+
 #include <assert.h>
 #include <stdarg.h>
 
@@ -249,6 +251,8 @@
 	}
 }
 
+#endif
+
 void *dm_malloc_aux(size_t s, const char *file __attribute__((unused)),
 		    int line __attribute__((unused)))
 {


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-28 20:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-28 20:37 LVM2/libdm/mm dbg_malloc.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2011-02-08 15:52 zkabelac
2011-01-28 16:01 zkabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).