blob: d8d3c9540208eb888de9d9db9f82616153087ee9 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/profiling/allocation_event.h"
namespace profiling {
AllocationEvent::AllocationEvent(AllocatorType allocator,
Address addr,
size_t sz,
const Backtrace* bt,
int context_id)
: allocator_(allocator),
address_(addr),
size_(sz),
backtrace_(bt),
context_id_(context_id) {}
AllocationEvent::AllocationEvent(Address addr) : address_(addr) {}
AllocationCountMap AllocationEventSetToCountMap(const AllocationEventSet& set) {
AllocationCountMap map;
for (const auto& alloc : set)
map[alloc]++;
return map;
}
} // namespace profiling