Fix 616-cha-unloading.
Consider cases of implicit arena reuse to prevent false positives.
Test: 616-cha-unloading
Change-Id: Ia1755fb66167279c08dd9ba59813402e798c0b79
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 3025818..ba90c17 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -8917,6 +8917,15 @@
}
}
+void ClassLinker::VisitAllocators(AllocatorVisitor* visitor) const {
+ for (const ClassLoaderData& data : class_loaders_) {
+ LinearAlloc* alloc = data.allocator;
+ if (alloc != nullptr && !visitor->Visit(alloc)) {
+ break;
+ }
+ }
+}
+
void ClassLinker::InsertDexFileInToClassLoader(ObjPtr<mirror::Object> dex_file,
ObjPtr<mirror::ClassLoader> class_loader) {
DCHECK(dex_file != nullptr);