diff options
| author | 2018-11-19 16:10:24 +0000 | |
|---|---|---|
| committer | 2018-11-20 09:52:46 +0000 | |
| commit | 1c42e753a46fa1a5281695413e7b7a67b0eb2dde (patch) | |
| tree | abda4b296d13924ba660cb8ec4e0c9c3e0452cf2 | |
| parent | d295a75d952742604eaae0530daea19dd6fd782c (diff) | |
ART: change reference to pointer in for-loop over all collectors
garbage_collectors_ is a vector of pointers, so using `auto*` to make it
explicit.
Test: Builds correctly
Change-Id: I413d0a9dcc902b75182a85eac5fdc2444625d179
| -rw-r--r-- | runtime/gc/heap.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index e7f14c39d4..4359bea421 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1064,7 +1064,7 @@ void Heap::RemoveSpace(space::Space* space) { uint64_t Heap::GetTotalGcCpuTime() { uint64_t sum = 0; - for (auto& collector : garbage_collectors_) { + for (auto* collector : garbage_collectors_) { sum += collector->GetTotalCpuTime(); } return sum; @@ -1076,7 +1076,7 @@ void Heap::DumpGcPerformanceInfo(std::ostream& os) { uint64_t total_duration = 0; // Dump cumulative loggers for each GC type. uint64_t total_paused_time = 0; - for (auto& collector : garbage_collectors_) { + for (auto* collector : garbage_collectors_) { total_duration += collector->GetCumulativeTimings().GetTotalNs(); total_paused_time += collector->GetTotalPausedTimeNs(); collector->DumpPerformanceInfo(os); @@ -1136,7 +1136,7 @@ void Heap::DumpGcPerformanceInfo(std::ostream& os) { } void Heap::ResetGcPerformanceInfo() { - for (auto& collector : garbage_collectors_) { + for (auto* collector : garbage_collectors_) { collector->ResetMeasurements(); } total_bytes_freed_ever_ = 0; @@ -1157,7 +1157,7 @@ void Heap::ResetGcPerformanceInfo() { uint64_t Heap::GetGcCount() const { uint64_t gc_count = 0U; - for (auto& collector : garbage_collectors_) { + for (auto* collector : garbage_collectors_) { gc_count += collector->GetCumulativeTimings().GetIterations(); } return gc_count; @@ -1165,7 +1165,7 @@ uint64_t Heap::GetGcCount() const { uint64_t Heap::GetGcTime() const { uint64_t gc_time = 0U; - for (auto& collector : garbage_collectors_) { + for (auto* collector : garbage_collectors_) { gc_time += collector->GetCumulativeTimings().GetTotalNs(); } return gc_time; @@ -3505,7 +3505,7 @@ bool Heap::IsMovableObject(ObjPtr<mirror::Object> obj) const { } collector::GarbageCollector* Heap::FindCollectorByGcType(collector::GcType gc_type) { - for (const auto& collector : garbage_collectors_) { + for (auto* collector : garbage_collectors_) { if (collector->GetCollectorType() == collector_type_ && collector->GetGcType() == gc_type) { return collector; |