diff options
Diffstat (limited to 'src/share/vm/memory/allocation.cpp')
-rw-r--r-- | src/share/vm/memory/allocation.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/share/vm/memory/allocation.cpp b/src/share/vm/memory/allocation.cpp index 92b335b10..f83eada81 100644 --- a/src/share/vm/memory/allocation.cpp +++ b/src/share/vm/memory/allocation.cpp @@ -66,10 +66,17 @@ bool MetaspaceObj::is_shared() const { } bool MetaspaceObj::is_metadata() const { - // ClassLoaderDataGraph::contains((address)this); has lock inversion problems + // GC Verify checks use this in guarantees. + // TODO: either replace them with is_metaspace_object() or remove them. + // is_metaspace_object() is slower than this test. This test doesn't + // seem very useful for metaspace objects anymore though. return !Universe::heap()->is_in_reserved(this); } +bool MetaspaceObj::is_metaspace_object() const { + return Metaspace::contains((void*)this); +} + void MetaspaceObj::print_address_on(outputStream* st) const { st->print(" {"INTPTR_FORMAT"}", this); } |