aboutsummaryrefslogtreecommitdiff
path: root/lib/asan/asan_memory_profile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asan/asan_memory_profile.cc')
-rw-r--r--lib/asan/asan_memory_profile.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/asan/asan_memory_profile.cc b/lib/asan/asan_memory_profile.cc
index 603284c8c688..8c86d9fe49f2 100644
--- a/lib/asan/asan_memory_profile.cc
+++ b/lib/asan/asan_memory_profile.cc
@@ -31,9 +31,9 @@ struct AllocationSite {
class HeapProfile {
public:
- HeapProfile() : allocations_(1024) {}
+ HeapProfile() { allocations_.reserve(1024); }
- void ProcessChunk(const AsanChunkView& cv) {
+ void ProcessChunk(const AsanChunkView &cv) {
if (cv.IsAllocated()) {
total_allocated_user_size_ += cv.UsedSize();
total_allocated_count_++;
@@ -49,10 +49,10 @@ class HeapProfile {
}
void Print(uptr top_percent, uptr max_number_of_contexts) {
- InternalSort(&allocations_, allocations_.size(),
- [](const AllocationSite &a, const AllocationSite &b) {
- return a.total_size > b.total_size;
- });
+ Sort(allocations_.data(), allocations_.size(),
+ [](const AllocationSite &a, const AllocationSite &b) {
+ return a.total_size > b.total_size;
+ });
CHECK(total_allocated_user_size_);
uptr total_shown = 0;
Printf("Live Heap Allocations: %zd bytes in %zd chunks; quarantined: "