diff options
| -rw-r--r-- | runtime/debugger.cc | 5 | ||||
| -rw-r--r-- | runtime/debugger.h | 2 | ||||
| -rw-r--r-- | runtime/gc/heap-inl.h | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/runtime/debugger.cc b/runtime/debugger.cc index 50bb0c9a08..c8bb537018 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -4375,10 +4375,7 @@ struct AllocRecordStackVisitor : public StackVisitor { size_t depth; }; -void Dbg::RecordAllocation(mirror::Class* type, size_t byte_count) { - Thread* self = Thread::Current(); - CHECK(self != nullptr); - +void Dbg::RecordAllocation(Thread* self, mirror::Class* type, size_t byte_count) { MutexLock mu(self, *Locks::alloc_tracker_lock_); if (recent_allocation_records_ == nullptr) { // In the process of shutting down recording, bail. diff --git a/runtime/debugger.h b/runtime/debugger.h index 3e16288a0f..219210e4aa 100644 --- a/runtime/debugger.h +++ b/runtime/debugger.h @@ -561,7 +561,7 @@ class Dbg { /* * Recent allocation tracking support. */ - static void RecordAllocation(mirror::Class* type, size_t byte_count) + static void RecordAllocation(Thread* self, mirror::Class* type, size_t byte_count) LOCKS_EXCLUDED(Locks::alloc_tracker_lock_) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); static void SetAllocTrackingEnabled(bool enabled) LOCKS_EXCLUDED(Locks::alloc_tracker_lock_); diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h index d1fb60061e..c97144990d 100644 --- a/runtime/gc/heap-inl.h +++ b/runtime/gc/heap-inl.h @@ -140,7 +140,7 @@ inline mirror::Object* Heap::AllocObjectWithAllocator(Thread* self, mirror::Clas } if (kInstrumented) { if (Dbg::IsAllocTrackingEnabled()) { - Dbg::RecordAllocation(klass, bytes_allocated); + Dbg::RecordAllocation(self, klass, bytes_allocated); } } else { DCHECK(!Dbg::IsAllocTrackingEnabled()); |