Use emplace_back over push_back to support unique_ptr.
Change-Id: Ie05a34dced7b3d90bfd14f0514e879a6a7351691
diff --git a/src/profiling/memory/unwinding.cc b/src/profiling/memory/unwinding.cc
index acdb86c..5b77eb3 100644
--- a/src/profiling/memory/unwinding.cc
+++ b/src/profiling/memory/unwinding.cc
@@ -158,14 +158,12 @@
strncmp(name + 5, "ashmem/", 7) != 0) {
flags |= unwindstack::MAPS_FLAGS_DEVICE_MAP;
}
- maps_.push_back(
+ maps_.emplace_back(
new unwindstack::MapInfo(nullptr, start, end, pgoff, flags, name));
});
}
void FileDescriptorMaps::Reset() {
- for (unwindstack::MapInfo* info : maps_)
- delete info;
maps_.clear();
}