diff options
Diffstat (limited to 'runtime/debugger.cc')
-rw-r--r-- | runtime/debugger.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/runtime/debugger.cc b/runtime/debugger.cc index 0f15e8b934..778b92851b 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -39,6 +39,7 @@ #include "gc/accounting/card_table-inl.h" #include "gc/allocation_record.h" #include "gc/scoped_gc_critical_section.h" +#include "gc/space/bump_pointer_space-walk-inl.h" #include "gc/space/large_object_space.h" #include "gc/space/space-inl.h" #include "handle_scope-inl.h" @@ -4813,13 +4814,6 @@ class HeapChunkContext { DISALLOW_COPY_AND_ASSIGN(HeapChunkContext); }; -static void BumpPointerSpaceCallback(mirror::Object* obj, void* arg) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) { - const size_t size = RoundUp(obj->SizeOf(), kObjectAlignment); - HeapChunkContext::HeapChunkJavaCallback( - obj, reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(obj) + size), size, arg); -} - void Dbg::DdmSendHeapSegments(bool native) { Dbg::HpsgWhen when = native ? gDdmNhsgWhen : gDdmHpsgWhen; Dbg::HpsgWhat what = native ? gDdmNhsgWhat : gDdmHpsgWhat; @@ -4839,6 +4833,12 @@ void Dbg::DdmSendHeapSegments(bool native) { // Send a series of heap segment chunks. HeapChunkContext context(what == HPSG_WHAT_MERGED_OBJECTS, native); + auto bump_pointer_space_visitor = [&](mirror::Object* obj) + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) { + const size_t size = RoundUp(obj->SizeOf(), kObjectAlignment); + HeapChunkContext::HeapChunkJavaCallback( + obj, reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(obj) + size), size, &context); + }; if (native) { UNIMPLEMENTED(WARNING) << "Native heap inspection is not supported"; } else { @@ -4861,7 +4861,7 @@ void Dbg::DdmSendHeapSegments(bool native) { } else if (space->IsBumpPointerSpace()) { ReaderMutexLock mu(self, *Locks::heap_bitmap_lock_); context.SetChunkOverhead(0); - space->AsBumpPointerSpace()->Walk(BumpPointerSpaceCallback, &context); + space->AsBumpPointerSpace()->Walk(bump_pointer_space_visitor); HeapChunkContext::HeapChunkJavaCallback(nullptr, nullptr, 0, &context); } else if (space->IsRegionSpace()) { heap->IncrementDisableMovingGC(self); @@ -4870,7 +4870,7 @@ void Dbg::DdmSendHeapSegments(bool native) { ScopedSuspendAll ssa(__FUNCTION__); ReaderMutexLock mu(self, *Locks::heap_bitmap_lock_); context.SetChunkOverhead(0); - space->AsRegionSpace()->Walk(BumpPointerSpaceCallback, &context); + space->AsRegionSpace()->Walk(bump_pointer_space_visitor); HeapChunkContext::HeapChunkJavaCallback(nullptr, nullptr, 0, &context); } heap->DecrementDisableMovingGC(self); |