From 635df850e5037be5093f64a87ec2e0a23bf7a50b Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Mon, 19 Nov 2012 11:23:10 -0800 Subject: [PATCH] mmap: Remove madvise() workaround Remove mmap() calling madvise(MADV_MERGEABLE) added in b8e1e9685efc82d6ac112b9aa316e7f6bf5186ca Change-Id: I80dbf6afe750348964d83097f993ea6cb8a065d5 --- libc/bionic/mmap.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libc/bionic/mmap.c b/libc/bionic/mmap.c index e097086cb..40a65385b 100644 --- a/libc/bionic/mmap.c +++ b/libc/bionic/mmap.c @@ -34,17 +34,10 @@ extern void* __mmap2(void*, size_t, int, int, int, size_t); #define MMAP2_SHIFT 12 void* mmap(void *addr, size_t size, int prot, int flags, int fd, long offset) { - void *ret; - if (offset & ((1UL << MMAP2_SHIFT)-1)) { errno = EINVAL; return MAP_FAILED; } - ret = __mmap2(addr, size, prot, flags, fd, (size_t)offset >> MMAP2_SHIFT); - - if (ret && (flags & (MAP_PRIVATE | MAP_ANONYMOUS))) - madvise(ret, size, MADV_MERGEABLE); - - return ret; + return __mmap2(addr, size, prot, flags, fd, (size_t)offset >> MMAP2_SHIFT); }