Browse Source

malloc.h: hide internal functions (mainly debug related)

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 14 years ago
parent
commit
7431f726e2
2 changed files with 13 additions and 8 deletions
  1. 1 0
      libc/stdlib/malloc-standard/mallinfo.c
  2. 12 8
      libc/stdlib/malloc-standard/malloc.h

+ 1 - 0
libc/stdlib/malloc-standard/mallinfo.c

@@ -15,6 +15,7 @@
 */
 
 #include "malloc.h"
+#include <stdio.h>	/* fprintf */
 
 
 /* ------------------------------ mallinfo ------------------------------ */

+ 12 - 8
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>