aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Delaney <piet.delaney@imgtec.com>2014-01-09 12:07:43 -0800
committerLorDClockaN <davor@losinj.com>2014-03-28 21:51:11 +0100
commit798643be51d789aec8f7ad6c7dfb1ee01774babb (patch)
tree02f36c16a27a49aa8352e3a71b4dd50f4dfe9935
parent97abad3f39d624eebd827ae59a5bbdae64056f9a (diff)
Use MAP_FIXED in remapNewHeap
The heap address must not change when it is remapped Change-Id: Ia44f178932e2afe8de3d4739e7085caae8568885 Signed-off-by: Pete Delaney <piet.delaney@imgtec.com> Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
-rw-r--r--vm/alloc/HeapSource.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm/alloc/HeapSource.cpp b/vm/alloc/HeapSource.cpp
index caf30af02..56d392ab3 100644
--- a/vm/alloc/HeapSource.cpp
+++ b/vm/alloc/HeapSource.cpp
@@ -414,7 +414,7 @@ static bool remapNewHeap(HeapSource* hs, Heap* newHeap)
ALOGE("Unable to create an ashmem region for the new heap");
return false;
}
- void* addr = mmap(newHeapBase, rem_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+ void* addr = mmap(newHeapBase, rem_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0);
int ret = close(fd);
if (addr == MAP_FAILED) {
ALOGE("Unable to map an ashmem region for the new heap");