summaryrefslogtreecommitdiff
path: root/runtime/gc_root.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/gc_root.h')
-rw-r--r--runtime/gc_root.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/gc_root.h b/runtime/gc_root.h
index 553f3d6418..19e2786ae2 100644
--- a/runtime/gc_root.h
+++ b/runtime/gc_root.h
@@ -214,7 +214,12 @@ class GcRoot {
return root_.IsNull();
}
- ALWAYS_INLINE GcRoot() {}
+ ALWAYS_INLINE GcRoot() : GcRoot(nullptr) {}
+ ALWAYS_INLINE GcRoot(std::nullptr_t) : root_() {
+ DCHECK(IsNull());
+ }
+ explicit ALWAYS_INLINE GcRoot(mirror::CompressedReference<mirror::Object> ref)
+ REQUIRES_SHARED(Locks::mutator_lock_);
explicit ALWAYS_INLINE GcRoot(MirrorType* ref)
REQUIRES_SHARED(Locks::mutator_lock_);
explicit ALWAYS_INLINE GcRoot(ObjPtr<MirrorType> ref)