From d6d49e56c2b7b11f474acb80cb02bb1fe9b7861e Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 2 Jun 2016 11:48:30 -0700 Subject: Hold dex caches live in class table Prevents temporary dex caches being unloaded for the same dex file. Usually this is OK, but if someone resolved a string in that dex cache, it could leave stale pointers in BSS. Also it can use extra memory in linear alloc if we allocate dex cache arrays multiple times. Bug: 29083330 (cherry picked from commit f284d448e3edd428b6ade473d0993028638b2064) Change-Id: Ie1b0b0cf835a998e19227cbb90014011a6cd40c4 --- runtime/class_table-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/class_table-inl.h') diff --git a/runtime/class_table-inl.h b/runtime/class_table-inl.h index 42e320ae71..d52365df6d 100644 --- a/runtime/class_table-inl.h +++ b/runtime/class_table-inl.h @@ -29,7 +29,7 @@ void ClassTable::VisitRoots(Visitor& visitor) { visitor.VisitRoot(root.AddressWithoutBarrier()); } } - for (GcRoot& root : dex_files_) { + for (GcRoot& root : strong_roots_) { visitor.VisitRoot(root.AddressWithoutBarrier()); } } @@ -42,7 +42,7 @@ void ClassTable::VisitRoots(const Visitor& visitor) { visitor.VisitRoot(root.AddressWithoutBarrier()); } } - for (GcRoot& root : dex_files_) { + for (GcRoot& root : strong_roots_) { visitor.VisitRoot(root.AddressWithoutBarrier()); } } -- cgit v1.2.3-59-g8ed1b