diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-12-06 03:33:06 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-12-06 03:33:06 +0000 |
commit | bd7bace793536f027790396d6358c14299e8595b (patch) | |
tree | dcc993baefecea2b27019336c4502e61d49b98c5 /libc/stdlib/malloc-simple | |
parent | 7608c85140162446c3830421eb94ae42a1bbb893 (diff) | |
download | uClibc-alpine-bd7bace793536f027790396d6358c14299e8595b.tar.bz2 uClibc-alpine-bd7bace793536f027790396d6358c14299e8595b.tar.xz |
Big merge from trunk. Stop the madness!
Diffstat (limited to 'libc/stdlib/malloc-simple')
-rw-r--r-- | libc/stdlib/malloc-simple/alloc.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c index 7f0a91f0b..d20768738 100644 --- a/libc/stdlib/malloc-simple/alloc.c +++ b/libc/stdlib/malloc-simple/alloc.c @@ -6,6 +6,8 @@ * Parts of the memalign code were stolen from malloc-930716. */ +#define munmap __munmap + #define _GNU_SOURCE #include <features.h> #include <unistd.h> @@ -109,14 +111,11 @@ void free(void *ptr) #ifdef L_memalign #ifdef __UCLIBC_HAS_THREADS__ -#include <pthread.h> +# include <pthread.h> pthread_mutex_t __malloc_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; -# define LOCK __pthread_mutex_lock(&__malloc_lock) -# define UNLOCK __pthread_mutex_unlock(&__malloc_lock); -#else -# define LOCK -# define UNLOCK #endif +#define LOCK __pthread_mutex_lock(&__malloc_lock) +#define UNLOCK __pthread_mutex_unlock(&__malloc_lock) /* List of blocks allocated with memalign or valloc */ struct alignlist |