summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/common_compiler_test.cc1
-rw-r--r--compiler/image_test.cc9
2 files changed, 7 insertions, 3 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index 1e6c03806b..86167ec9bf 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -404,6 +404,7 @@ void CommonCompilerTest::ReserveImageSpace() {
// Reserve where the image will be loaded up front so that other parts of test set up don't
// accidentally end up colliding with the fixed memory address when we need to load the image.
std::string error_msg;
+ MemMap::Init();
image_reservation_.reset(MemMap::MapAnonymous("image reservation",
reinterpret_cast<byte*>(ART_BASE_ADDRESS),
(size_t)100 * 1024 * 1024, // 100MB
diff --git a/compiler/image_test.cc b/compiler/image_test.cc
index 3d119bbaad..355036be57 100644
--- a/compiler/image_test.cc
+++ b/compiler/image_test.cc
@@ -129,14 +129,17 @@ TEST_F(ImageTest, WriteRead) {
compiler_driver_.reset();
// Tear down old runtime before making a new one, clearing out misc state.
+
+ // Remove the reservation of the memory for use to load the image.
+ // Need to do this before we reset the runtime.
+ UnreserveImageSpace();
+
runtime_.reset();
java_lang_dex_file_ = NULL;
+ MemMap::Init();
std::unique_ptr<const DexFile> dex(LoadExpectSingleDexFile(GetLibCoreDexFileName().c_str()));
- // Remove the reservation of the memory for use to load the image.
- UnreserveImageSpace();
-
RuntimeOptions options;
std::string image("-Ximage:");
image.append(image_location.GetFilename());