summaryrefslogtreecommitdiff
path: root/runtime/class_linker_test.cc
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2021-03-02 15:07:26 +0000
committer David Srbecky <dsrbecky@google.com> 2021-09-28 12:36:00 +0000
commite153a62e8e8a2c42f86d2db87c8188cd0d7bef6b (patch)
tree254fbf33dea442d711ffa4a62bbcf2a4fd392424 /runtime/class_linker_test.cc
parent282795ca98d955697823aea6fd9c6b3f51780045 (diff)
Revert^2 "Lazily allocate DexCache arrays."
We rarely need the DexCache for compiled code. Delay the allocation in hope we never need it. This reduces DexCache memory usage by ~25% at startup. This reverts commit b9b7d91f5ceb0b738e1774992fd6fe205c6091e9. Bug: b/181097963 Test: test.py -b --host Test: run previously failing go/ab build in forrest Change-Id: I818ad8f75d2d5387891a96edec49bc7933cd171f
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r--runtime/class_linker_test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index e0f498d6aa..8e51149236 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -1541,8 +1541,9 @@ TEST_F(ClassLinkerTest, RegisterDexFileName) {
nullptr,
nullptr));
// Make a copy of the dex cache with changed name.
- LinearAlloc* alloc = Runtime::Current()->GetLinearAlloc();
- dex_cache.Assign(class_linker->AllocAndInitializeDexCache(Thread::Current(), *dex_file, alloc));
+ dex_cache.Assign(class_linker->AllocAndInitializeDexCache(Thread::Current(),
+ *dex_file,
+ /* class_loader= */ nullptr));
DCHECK_EQ(dex_cache->GetLocation()->CompareTo(location.Get()), 0);
{
WriterMutexLock mu(soa.Self(), *Locks::dex_lock_);