Commit 69972208 authored by mattloring's avatar mattloring Committed by Commit bot

Preallocate sample buffer to avoid resizes

R=ofrobots@google.com
BUG=

Review URL: https://codereview.chromium.org/1712893002

Cr-Commit-Position: refs/heads/master@{#34161}
parent 4f0be519
......@@ -182,6 +182,7 @@ v8::AllocationProfile::Node* SamplingHeapProfiler::TranslateAllocationNode(
int line = v8::AllocationProfile::kNoLineNumberInfo;
int column = v8::AllocationProfile::kNoColumnNumberInfo;
std::vector<v8::AllocationProfile::Allocation> allocations;
allocations.reserve(node->allocations_.size());
if (node->script_id_ != v8::UnboundScript::kNoScriptId) {
// Cannot use std::map<T>::at because it is not available on android.
auto non_const_scripts = const_cast<std::map<int, Script*>&>(scripts);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment