summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/malloc-simple/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/malloc-simple/alloc.c')
-rw-r--r--libc/stdlib/malloc-simple/alloc.c11
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