From 73f88c8f7e9733dd3252b464f5ca0108ff7297c4 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 6 Sep 2002 04:58:53 +0000 Subject: Update debugging hooks. --- libc/stdlib/malloc/malloc.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libc/stdlib/malloc/malloc.h') diff --git a/libc/stdlib/malloc/malloc.h b/libc/stdlib/malloc/malloc.h index 30a28b776..4071a4ffb 100644 --- a/libc/stdlib/malloc/malloc.h +++ b/libc/stdlib/malloc/malloc.h @@ -122,10 +122,13 @@ extern malloc_mutex_t __malloc_sbrk_lock; #endif /* !likely */ -/* Define MALLOC_DEBUGGING to cause malloc to emit debugging info to stderr. */ +/* Define MALLOC_DEBUGGING to cause malloc to emit debugging info to stderr + when the variable __malloc_debug is set to true. */ #ifdef MALLOC_DEBUGGING #include -#define MALLOC_DEBUG(fmt, args...) fprintf (stderr, fmt , ##args) +extern int __malloc_debug; +#define MALLOC_DEBUG(fmt, args...) \ + (__malloc_debug ? fprintf (stderr, fmt , ##args) : 0) #else #define MALLOC_DEBUG(fmt, args...) (void)0 #endif -- cgit v1.2.3