summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-10-14 15:01:24 -0700
committerMathieu Chartier <mathieuc@google.com>2014-10-14 15:43:21 -0700
commit6e88ef6b604a7a945a466784580c42e6554c1289 (patch)
tree1e296564787b51514cf2eca5b732647c1a82912e /runtime/runtime.cc
parent58e51f38e2304a08aa9ec380383e0b3614f96a96 (diff)
downloadart-6e88ef6b604a7a945a466784580c42e6554c1289.zip
art-6e88ef6b604a7a945a466784580c42e6554c1289.tar.gz
art-6e88ef6b604a7a945a466784580c42e6554c1289.tar.bz2
Change MemMap::maps_ to not be global variable
Runtime.exit() was causing globals to get destructed at the same time that another thread was using it for allocating a new mem map. Bug: 17962201 Change-Id: I400cb7b8141d858f3c08a6fe59a02838c04c6962
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 42d05a9..3bd825b 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -193,6 +193,7 @@ Runtime::~Runtime() {
Thread::Shutdown();
QuasiAtomic::Shutdown();
verifier::MethodVerifier::Shutdown();
+ MemMap::Shutdown();
// TODO: acquire a static mutex on Runtime to avoid racing.
CHECK(instance_ == nullptr || instance_ == this);
instance_ = nullptr;
@@ -645,6 +646,8 @@ static size_t OpenDexFiles(const std::vector<std::string>& dex_filenames,
bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized) {
CHECK_EQ(sysconf(_SC_PAGE_SIZE), kPageSize);
+ MemMap::Init();
+
std::unique_ptr<ParsedOptions> options(ParsedOptions::Create(raw_options, ignore_unrecognized));
if (options.get() == nullptr) {
LOG(ERROR) << "Failed to parse options";