summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Stefano Cianciulli <scianciulli@google.com> 2022-12-06 13:01:01 +0000
committer Stefano Cianciulli <scianciulli@google.com> 2023-01-09 15:23:46 +0000
commit77a4cede425f31f825f78694197d34b63a6c2fd5 (patch)
tree1a1a3f5f460c0477d1671674f0a976f13a16d727
parentf6f5ada7b8231d19898726b37fa7db674a006065 (diff)
Change ToRawPointers method call to MakeNonOwningPointerVector in reporter.cc
This CL removes the code for the ToRawPointers method previously introduced in libartbase/base/utils.h, as an equivalent MakeNonOwningPointerVector method exists in libartbase/base/stl_util.h Bug: 246330418 Test: atest ArtGtestsTargetChroot Merged-In: Ie412542e014899d50a47a6375b730c70211c6c26 Merged-In: I06aa2d733e5ee5bd00429b6dff585394bcc807d0 Change-Id: Ia1920bf503f5de1d278ee75dc03fa0d7265fad08
-rw-r--r--libartbase/base/utils.h13
-rw-r--r--runtime/metrics/reporter.cc7
2 files changed, 4 insertions, 16 deletions
diff --git a/libartbase/base/utils.h b/libartbase/base/utils.h
index b32dcec665..f311f09975 100644
--- a/libartbase/base/utils.h
+++ b/libartbase/base/utils.h
@@ -186,19 +186,6 @@ bool IsAddressKnownBackedByFileOrShared(const void* addr);
// Returns the number of threads running.
int GetTaskCount();
-// Returns a vector holding the raw pointer targets of the elements of "unique_pointers", a vector
-// of smart pointers. This does not affect the target objects e.g. by incrementing ref-counts; it's
-// a raw pointer read.
-template <typename T>
-static std::vector<T*> ToRawPointers(const std::vector<std::unique_ptr<T>>& unique_pointers) {
- std::vector<T*> raw_pointers;
- raw_pointers.reserve(unique_pointers.size());
- for (const std::unique_ptr<T>& p : unique_pointers) {
- raw_pointers.push_back(p.get());
- }
- return raw_pointers;
-}
-
} // namespace art
#endif // ART_LIBARTBASE_BASE_UTILS_H_
diff --git a/runtime/metrics/reporter.cc b/runtime/metrics/reporter.cc
index 736ef7f879..6fc1a148aa 100644
--- a/runtime/metrics/reporter.cc
+++ b/runtime/metrics/reporter.cc
@@ -16,11 +16,12 @@
#include "reporter.h"
-#include <algorithm>
-
#include <android-base/parseint.h>
+#include <algorithm>
+
#include "base/flags.h"
+#include "base/stl_util.h"
#include "oat_file_manager.h"
#include "runtime.h"
#include "runtime_options.h"
@@ -208,7 +209,7 @@ void MetricsReporter::ReportMetrics() {
session_started_ = true;
}
- metrics->ReportAllMetricsAndResetValueMetrics(ToRawPointers(backends_));
+ metrics->ReportAllMetricsAndResetValueMetrics(MakeNonOwningPointerVector(backends_));
}
void MetricsReporter::UpdateSessionInBackends() {