Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4129)

Unified Diff: base/profiler/native_stack_sampler.cc

Issue 2601633002: Use a common buffer across all instances for stack-copy. (Closed)
Patch Set: addressed review comments by wittman Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/profiler/native_stack_sampler.h ('k') | base/profiler/native_stack_sampler_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler/native_stack_sampler.cc
diff --git a/base/profiler/native_stack_sampler.cc b/base/profiler/native_stack_sampler.cc
index 968455f13e007c7b2c26290249a79883c8805d2d..b78d725a5a368f6c58f70fa6ed5e3599446d0149 100644
--- a/base/profiler/native_stack_sampler.cc
+++ b/base/profiler/native_stack_sampler.cc
@@ -4,12 +4,29 @@
#include "base/profiler/native_stack_sampler.h"
+#include "base/memory/ptr_util.h"
+
namespace base {
+NativeStackSampler::StackBuffer::StackBuffer(size_t buffer_size)
+ : buffer_(new uintptr_t[(buffer_size + sizeof(uintptr_t) - 1) /
+ sizeof(uintptr_t)]),
+ size_(buffer_size) {}
+
+NativeStackSampler::StackBuffer::~StackBuffer() {}
+
NativeStackSampler::NativeStackSampler() {}
NativeStackSampler::~NativeStackSampler() {}
+std::unique_ptr<NativeStackSampler::StackBuffer>
+NativeStackSampler::CreateStackBuffer() {
+ size_t size = GetStackBufferSize();
+ if (size == 0)
+ return nullptr;
+ return MakeUnique<StackBuffer>(size);
+}
+
NativeStackSamplerTestDelegate::~NativeStackSamplerTestDelegate() {}
NativeStackSamplerTestDelegate::NativeStackSamplerTestDelegate() {}
« no previous file with comments | « base/profiler/native_stack_sampler.h ('k') | base/profiler/native_stack_sampler_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698