Revert "Revert "Add one LinearAlloc per ClassLoader""
Issue was fixed by:
https://android-review.googlesource.com/#/c/171945/
Bug: 22720414
This reverts commit 7de5dfe37f3cf24e1166412b589f6f67dcd1f1c0.
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index fba9d37..fe97394 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -947,10 +947,8 @@
if (IsCompiler() && Is64BitInstructionSet(kRuntimeISA)) {
// 4gb, no malloc. Explanation in header.
low_4gb_arena_pool_.reset(new ArenaPool(false, true));
- linear_alloc_.reset(new LinearAlloc(low_4gb_arena_pool_.get()));
- } else {
- linear_alloc_.reset(new LinearAlloc(arena_pool_.get()));
}
+ linear_alloc_.reset(CreateLinearAlloc());
BlockSignals();
InitPlatformSignalHandlers();
@@ -1791,4 +1789,10 @@
return verify_ == verifier::VerifyMode::kSoftFail;
}
+LinearAlloc* Runtime::CreateLinearAlloc() {
+ return (IsCompiler() && Is64BitInstructionSet(kRuntimeISA))
+ ? new LinearAlloc(low_4gb_arena_pool_.get())
+ : new LinearAlloc(arena_pool_.get());
+}
+
} // namespace art