Index: glib/gmem.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gmem.c,v
retrieving revision 1.56
diff -u -p -d -r1.56 gmem.c
--- glib/gmem.c	20 Mar 2006 20:21:25 -0000	1.56
+++ glib/gmem.c	21 Apr 2006 09:10:06 -0000
@@ -38,6 +38,8 @@
 #include "gthreadinit.h"
 #include "galias.h"
 
+#include "valgrind/valgrind.h"
+
 #define MEM_PROFILE_TABLE_SIZE 4096
 
 
@@ -684,6 +686,8 @@ gboolean g_mem_gc_friendly = TRUE;
 gboolean g_mem_gc_friendly = FALSE;
 #endif
 
+gboolean g_mem_in_checker = FALSE;
+
 static void
 g_mem_init_nomessage (void)
 {
@@ -702,6 +706,13 @@ g_mem_init_nomessage (void)
     {
       g_mem_gc_friendly = TRUE;
     }
+
+  /* Add checks for other memory checkers here */
+  if (RUNNING_ON_VALGRIND)
+    {
+      g_mem_in_checker = TRUE;
+    }
+
   g_mem_initialized = TRUE;
 }
 
Index: glib/gmem.h
===================================================================
RCS file: /cvs/gnome/glib/glib/gmem.h,v
retrieving revision 1.18
diff -u -p -d -r1.18 gmem.h
--- glib/gmem.h	25 Jan 2006 15:51:43 -0000	1.18
+++ glib/gmem.h	21 Apr 2006 09:10:06 -0000
@@ -93,6 +93,7 @@ void	 g_mem_set_vtable (GMemVTable	*vtab
 gboolean g_mem_is_system_malloc (void);
 
 GLIB_VAR gboolean g_mem_gc_friendly;
+GLIB_VAR gboolean g_mem_in_checker;
 
 /* Memory profiler and checker, has to be enabled via g_mem_set_vtable()
  */
