summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-11 23:54:37 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-11 23:54:37 +0000
commita99617fe8fdb56b3e877558bfd6572ce65ad39de (patch)
tree26c3182125188cb7681885830ea7e32e179c7565 /libc/stdlib/malloc
parentd1c3ee2a075fc4e855e352e5a5cf10371f2e77aa (diff)
Finish reorganizing things. At least I think I've finished.
Diffstat (limited to 'libc/stdlib/malloc')
-rw-r--r--libc/stdlib/malloc/Makefile2
-rw-r--r--libc/stdlib/malloc/malloc.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/libc/stdlib/malloc/Makefile b/libc/stdlib/malloc/Makefile
index fe3f8b424..0824e71a8 100644
--- a/libc/stdlib/malloc/Makefile
+++ b/libc/stdlib/malloc/Makefile
@@ -20,7 +20,7 @@
# other sundry sources. Files within this library are copyright by their
# respective copyright holders.
-TOPDIR=../
+TOPDIR=../../
include $(TOPDIR)Rules.make
LIBC=$(TOPDIR)libc.a
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;