summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/malloc-standard/malloc.h
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2008-07-09 16:47:01 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2008-07-09 16:47:01 +0000
commit62a21af8006ab04282fdc354c5b4dc765f56d058 (patch)
tree568761d58289238aa14cced3f0010809d4d28c00 /libc/stdlib/malloc-standard/malloc.h
parentef250238dc1572caf859c2b64652f9cdfb0d9e42 (diff)
downloaduClibc-alpine-62a21af8006ab04282fdc354c5b4dc765f56d058.tar.bz2
uClibc-alpine-62a21af8006ab04282fdc354c5b4dc765f56d058.tar.xz
BIG BIG commit: all left files merged from trunk [rev 22714]. Currenntly NPTL sh4 port build and work fine. All committed to allow Khem Ray working on a working branch to integrate the ARM nptl port. MIPS nptl port not tested but should still building and working fine. There are some other part non yet merged with trunk (misc/internals and some headers file that need some more work). Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/stdlib/malloc-standard/malloc.h')
-rw-r--r--libc/stdlib/malloc-standard/malloc.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h
index 453d69736..389f1f7d4 100644
--- a/libc/stdlib/malloc-standard/malloc.h
+++ b/libc/stdlib/malloc-standard/malloc.h
@@ -22,18 +22,17 @@
#include <malloc.h>
#include <stdlib.h>
#include <sys/mman.h>
+#include <bits/uClibc_mutex.h>
libc_hidden_proto(mmap)
libc_hidden_proto(sysconf)
libc_hidden_proto(sbrk)
libc_hidden_proto(abort)
-#ifdef __UCLIBC_HAS_THREADS__
-# include <pthread.h>
-extern pthread_mutex_t __malloc_lock;
-#endif
-#define LOCK __pthread_mutex_lock(&__malloc_lock)
-#define UNLOCK __pthread_mutex_unlock(&__malloc_lock)
+
+__UCLIBC_MUTEX_EXTERN(__malloc_lock);
+#define __MALLOC_LOCK __UCLIBC_MUTEX_LOCK(__malloc_lock)
+#define __MALLOC_UNLOCK __UCLIBC_MUTEX_UNLOCK(__malloc_lock)
@@ -925,7 +924,7 @@ extern struct malloc_state __malloc_state; /* never directly referenced */
At most one "call" to get_malloc_state is made per invocation of
the public versions of malloc and free, but other routines
that in turn invoke malloc and/or free may call more then once.
- Also, it is called in check* routines if __MALLOC_DEBUGGING is set.
+ Also, it is called in check* routines if __UCLIBC_MALLOC_DEBUGGING__ is set.
*/
#define get_malloc_state() (&(__malloc_state))
@@ -935,7 +934,7 @@ void __malloc_consolidate(mstate) attribute_hidden;
/* Debugging support */
-#if ! __MALLOC_DEBUGGING
+#ifndef __UCLIBC_MALLOC_DEBUGGING__
#define check_chunk(P)
#define check_free_chunk(P)