summaryrefslogtreecommitdiffstats
path: root/runtime/class_linker.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_linker.h')
-rw-r--r--runtime/class_linker.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index 2f6b754521..fa70f65bca 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -97,6 +97,14 @@ class ClassLoaderVisitor {
REQUIRES_SHARED(Locks::classlinker_classes_lock_, Locks::mutator_lock_) = 0;
};
+class AllocatorVisitor {
+ public:
+ virtual ~AllocatorVisitor() {}
+ // Return true to continue visiting.
+ virtual bool Visit(LinearAlloc* alloc)
+ REQUIRES_SHARED(Locks::classlinker_classes_lock_, Locks::mutator_lock_) = 0;
+};
+
class ClassLinker {
public:
// Well known mirror::Class roots accessed via GetClassRoot.
@@ -664,6 +672,11 @@ class ClassLinker {
REQUIRES(!Locks::classlinker_classes_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
+ // Visit all of the allocators that belong to classloaders except boot classloader.
+ // This is used by 616-cha-unloading test to confirm memory reuse.
+ void VisitAllocators(AllocatorVisitor* visitor) const
+ REQUIRES_SHARED(Locks::classlinker_classes_lock_, Locks::mutator_lock_);
+
// Throw the class initialization failure recorded when first trying to initialize the given
// class.
void ThrowEarlierClassFailure(ObjPtr<mirror::Class> c, bool wrap_in_no_class_def = false)