summaryrefslogtreecommitdiffstats
path: root/runtime/gc
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-03-13 15:10:27 -0700
committerBrian Carlstrom <bdc@google.com>2014-03-14 15:17:32 -0700
commit4fb5df8453367aa3f160ac230c03a7a98a28e562 (patch)
tree069df39819c0f7e8f6f0d4af8569d8a06dafdaf9 /runtime/gc
parentb6825e67ea7b85a910258713910a443cfec747e4 (diff)
downloadart-4fb5df8453367aa3f160ac230c03a7a98a28e562.zip
art-4fb5df8453367aa3f160ac230c03a7a98a28e562.tar.gz
art-4fb5df8453367aa3f160ac230c03a7a98a28e562.tar.bz2
Make MemMap::MapAnonymous() fail if the requested address is not available.
Change MapAnonymous() so that a requested address vs. actual map address mismatch will cause a failure. The existing MapAnonymous() call sites do not check this. This should prevent potential rare case bugs where mmap does not happen to map a region at an specified address. There's a potential bug that if MapAnonymous() does not guarantee the requested address (and there's a gap between the image/oat files and the zygote/malloc space), then GC could in theory allocate a large object space in the gap. This would break the GC notion of the immune space. This change will prevent this by causing all non-moving spaces to be (really) adjacent, with no gaps in between, which CL 87711 missed. Change-Id: Id4adb0e30adbad497334d7e00def4c0c66b15719
Diffstat (limited to 'runtime/gc')
-rw-r--r--runtime/gc/space/image_space.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index 5480639..bb52c66 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -201,7 +201,7 @@ ImageSpace* ImageSpace::Init(const char* image_file_name, bool validate_oat_file
UniquePtr<MemMap> map(MemMap::MapFileAtAddress(image_header.GetImageBegin(),
image_header.GetImageSize(),
PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED,
+ MAP_PRIVATE,
file->Fd(),
0,
false,