summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-09-13 05:18:12 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-13 05:18:12 +0000
commit9b43d91b21c83cb5fb3f618e3f8053fd7c39c906 (patch)
tree8d3a5fd646d6e41ce084364576c7793fe06654e2 /runtime
parent7bf641ed4d7d87f70e0e3a052ad35d15031cffcd (diff)
parent844506b3f75b4643de8b326855daf03c2fbcc99c (diff)
downloadart-9b43d91b21c83cb5fb3f618e3f8053fd7c39c906.zip
art-9b43d91b21c83cb5fb3f618e3f8053fd7c39c906.tar.gz
art-9b43d91b21c83cb5fb3f618e3f8053fd7c39c906.tar.bz2
Merge "Pass current thread as argument to alloc instrumentation."
Diffstat (limited to 'runtime')
-rw-r--r--runtime/debugger.cc5
-rw-r--r--runtime/debugger.h2
-rw-r--r--runtime/gc/heap-inl.h2
3 files changed, 3 insertions, 6 deletions
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 50bb0c9..c8bb537 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 3e16288..219210e 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 d1fb600..c971449 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());