[git commit future 1/1] malloc.h: hide internal functions (mainly debug related)

Khem Raj raj.khem at gmail.com
Sat Mar 19 18:51:25 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=8cd0efb03e2b7b34f832cd2422d8856664849e34
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 libc/stdlib/malloc-standard/mallinfo.c |    1 +
 libc/stdlib/malloc-standard/malloc.h   |   20 ++++++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/libc/stdlib/malloc-standard/mallinfo.c b/libc/stdlib/malloc-standard/mallinfo.c
index d60d6d9..3064e53 100644
--- a/libc/stdlib/malloc-standard/mallinfo.c
+++ b/libc/stdlib/malloc-standard/mallinfo.c
@@ -15,6 +15,7 @@
 */
 
 #include "malloc.h"
+#include <stdio.h>	/* fprintf */
 
 
 /* ------------------------------ mallinfo ------------------------------ */
diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h
index 73d4b12..9b411bd 100644
--- a/libc/stdlib/malloc-standard/malloc.h
+++ b/libc/stdlib/malloc-standard/malloc.h
@@ -26,7 +26,11 @@
 
 
 
-__UCLIBC_MUTEX_EXTERN(__malloc_lock);
+__UCLIBC_MUTEX_EXTERN(__malloc_lock)
+#if defined __UCLIBC_HAS_THREADS__ && !defined __LINUXTHREADS_OLD__
+	attribute_hidden
+#endif
+	;
 #define __MALLOC_LOCK		__UCLIBC_MUTEX_LOCK(__malloc_lock)
 #define __MALLOC_UNLOCK		__UCLIBC_MUTEX_UNLOCK(__malloc_lock)
 
@@ -910,7 +914,7 @@ typedef struct malloc_state *mstate;
    malloc relies on the property that malloc_state is initialized to
    all zeroes (as is true of C statics).
 */
-extern struct malloc_state __malloc_state;  /* never directly referenced */
+extern struct malloc_state __malloc_state attribute_hidden;  /* never directly referenced */
 
 /*
    All uses of av_ are via get_malloc_state().
@@ -947,12 +951,12 @@ void   __malloc_consolidate(mstate) attribute_hidden;
 #define check_malloced_chunk(P,N)   __do_check_malloced_chunk(P,N)
 #define check_malloc_state()        __do_check_malloc_state()
 
-extern void __do_check_chunk(mchunkptr p);
-extern void __do_check_free_chunk(mchunkptr p);
-extern void __do_check_inuse_chunk(mchunkptr p);
-extern void __do_check_remalloced_chunk(mchunkptr p, size_t s);
-extern void __do_check_malloced_chunk(mchunkptr p, size_t s);
-extern void __do_check_malloc_state(void);
+extern void __do_check_chunk(mchunkptr p) attribute_hidden;
+extern void __do_check_free_chunk(mchunkptr p) attribute_hidden;
+extern void __do_check_inuse_chunk(mchunkptr p) attribute_hidden;
+extern void __do_check_remalloced_chunk(mchunkptr p, size_t s) attribute_hidden;
+extern void __do_check_malloced_chunk(mchunkptr p, size_t s) attribute_hidden;
+extern void __do_check_malloc_state(void) attribute_hidden;
 
 #include <assert.h>
 
-- 
1.7.3.4



More information about the uClibc-cvs mailing list