diff options
Diffstat (limited to 'libc/stdlib/malloc-standard/malloc.h')
-rw-r--r-- | libc/stdlib/malloc-standard/malloc.h | 15 |
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) |