summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/stdlib/malloc-standard/mallinfo.c1
-rw-r--r--libc/stdlib/malloc-standard/malloc.h20
2 files changed, 13 insertions, 8 deletions
diff --git a/libc/stdlib/malloc-standard/mallinfo.c b/libc/stdlib/malloc-standard/mallinfo.c
index d60d6d9b5..3064e53b0 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 73d4b124d..9b411bdb8 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>