summaryrefslogtreecommitdiff
path: root/libsanitizer/sanitizer_common/sanitizer_stackdepot.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libsanitizer/sanitizer_common/sanitizer_stackdepot.cc')
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_stackdepot.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/libsanitizer/sanitizer_common/sanitizer_stackdepot.cc b/libsanitizer/sanitizer_common/sanitizer_stackdepot.cc
index 816a35cfb46..d48f7d27689 100644
--- a/libsanitizer/sanitizer_common/sanitizer_stackdepot.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_stackdepot.cc
@@ -133,8 +133,8 @@ bool StackDepotReverseMap::IdDescPair::IdComparator(
return a.id < b.id;
}
-StackDepotReverseMap::StackDepotReverseMap()
- : map_(StackDepotGetStats()->n_uniq_ids + 100) {
+StackDepotReverseMap::StackDepotReverseMap() {
+ map_.reserve(StackDepotGetStats()->n_uniq_ids + 100);
for (int idx = 0; idx < StackDepot::kTabSize; idx++) {
atomic_uintptr_t *p = &theDepot.tab[idx];
uptr v = atomic_load(p, memory_order_consume);
@@ -144,7 +144,7 @@ StackDepotReverseMap::StackDepotReverseMap()
map_.push_back(pair);
}
}
- InternalSort(&map_, map_.size(), IdDescPair::IdComparator);
+ Sort(map_.data(), map_.size(), &IdDescPair::IdComparator);
}
StackTrace StackDepotReverseMap::Get(u32 id) {