summaryrefslogtreecommitdiff
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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c
index cf4835c97..f31105d4e 100644
--- a/libc/stdlib/malloc-simple/alloc.c
+++ b/libc/stdlib/malloc-simple/alloc.c
@@ -67,8 +67,12 @@ void *calloc(size_t num, size_t size)
void *malloc(size_t len)
{
void *result = mmap((void *) 0, len, PROT_READ | PROT_WRITE,
- //MAP_SHARED | MAP_ANONYMOUS, 0, 0);
- MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+#ifdef __HAS_NO_MMU__
+ MAP_SHARED | MAP_ANONYMOUS, 0, 0
+#else
+ MAP_PRIVATE | MAP_ANONYMOUS, 0, 0
+#endif
+ );
if (result == (void *) -1)
return 0;