summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/malloc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/malloc')
-rw-r--r--libc/stdlib/malloc/free.c2
-rw-r--r--libc/stdlib/malloc/heap.h10
-rw-r--r--libc/stdlib/malloc/malloc_debug.c2
3 files changed, 5 insertions, 9 deletions
diff --git a/libc/stdlib/malloc/free.c b/libc/stdlib/malloc/free.c
index 88684e6df..eb35e78ee 100644
--- a/libc/stdlib/malloc/free.c
+++ b/libc/stdlib/malloc/free.c
@@ -11,6 +11,8 @@
* Written by Miles Bader <miles@gnu.org>
*/
+#define munmap __munmap
+
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
diff --git a/libc/stdlib/malloc/heap.h b/libc/stdlib/malloc/heap.h
index 0210d9098..ab1a73896 100644
--- a/libc/stdlib/malloc/heap.h
+++ b/libc/stdlib/malloc/heap.h
@@ -135,14 +135,8 @@ extern void __heap_dump (struct heap *heap, const char *str);
extern void __heap_check (struct heap *heap, const char *str);
-#ifdef HEAP_USE_LOCKING
-# define __heap_lock(heap) __pthread_mutex_lock (&(heap)->lock)
-# define __heap_unlock(heap) __pthread_mutex_unlock (&(heap)->lock)
-#else /* !__UCLIBC_HAS_THREADS__ */
-/* Without threads, mutex operations are a nop. */
-# define __heap_lock(heap) (void)0
-# define __heap_unlock(heap) (void)0
-#endif /* HEAP_USE_LOCKING */
+#define __heap_lock(heap) __pthread_mutex_lock (&(heap)->lock)
+#define __heap_unlock(heap) __pthread_mutex_unlock (&(heap)->lock)
/* Delete the free-area FA from HEAP. */
diff --git a/libc/stdlib/malloc/malloc_debug.c b/libc/stdlib/malloc/malloc_debug.c
index d231fa7b6..b93b1eac6 100644
--- a/libc/stdlib/malloc/malloc_debug.c
+++ b/libc/stdlib/malloc/malloc_debug.c
@@ -55,7 +55,7 @@ __malloc_debug_printf (int indent, const char *fmt, ...)
void
__malloc_debug_init (void)
{
- char *ev = getenv ("MALLOC_DEBUG");
+ char *ev = __getenv ("MALLOC_DEBUG");
if (ev)
{
int val = atoi (ev);