diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-07-15 08:06:25 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-07-15 08:06:25 +0000 |
commit | 921fde55c32eecb4087ca59b41982b7e5c4731d1 (patch) | |
tree | f3a4add7cdcb203f128eab7cb66360443823bb2f /libc/stdlib/malloc-simple | |
parent | 288a56c4a2ddb87a61fe11a3c1d3a95a01b70878 (diff) |
Use MAP_PRIVATE whenever __ARCH_HAS_MMU__ is set.
Only use MAP_SHARED when mmu-less.
Diffstat (limited to 'libc/stdlib/malloc-simple')
-rw-r--r-- | libc/stdlib/malloc-simple/alloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c index c0f702676..68cd77665 100644 --- a/libc/stdlib/malloc-simple/alloc.c +++ b/libc/stdlib/malloc-simple/alloc.c @@ -33,14 +33,14 @@ void *malloc(size_t size) #ifdef __ARCH_HAS_MMU__ result = mmap((void *) 0, size + sizeof(size_t), PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); if (result == MAP_FAILED) return 0; * (size_t *) result = size; return(result + sizeof(size_t)); #else result = mmap((void *) 0, size, PROT_READ | PROT_WRITE, - MAP_SHARED | MAP_ANONYMOUS, -1, 0); + MAP_SHARED | MAP_ANONYMOUS, 0, 0); if (result == MAP_FAILED) return 0; return(result); |