summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/malloc/malloc.c')
-rw-r--r--libc/stdlib/malloc/malloc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c
index 1a0b61aa5..4ed9fe873 100644
--- a/libc/stdlib/malloc/malloc.c
+++ b/libc/stdlib/malloc/malloc.c
@@ -190,7 +190,13 @@ static void *hunk_alloc(int size)
if ((p = free_h[size]) == NULL)
{
if ((p = (Hunk_t*)mmap(HUNK_MSTART,HUNK_MSIZE,PROT_READ|PROT_WRITE,
- MAP_PRIVATE|MAP_ANON,0,0)) == (Hunk_t*)MAP_FAILED)
+#ifdef __HAS_NO_MMU__
+ MAP_PRIVATE|MAP_ANONYMOUS
+#else
+
+ MAP_SHARED|MAP_ANONYMOUS
+#endif
+ ,0,0)) == (Hunk_t*)MAP_FAILED)
return NULL;
memset(p,0,HUNK_MSIZE);
p->id = HUNK_ID;