Index: src/cpu-profiler-inl.h |
diff --git a/src/cpu-profiler-inl.h b/src/cpu-profiler-inl.h |
index b704417795c21dc9eaf0255f9b224e37d7f9c250..c6720eedd9ae336cdd5b127f9ce7b1d4bc4c141f 100644 |
--- a/src/cpu-profiler-inl.h |
+++ b/src/cpu-profiler-inl.h |
@@ -32,6 +32,7 @@ |
#ifdef ENABLE_LOGGING_AND_PROFILING |
+#include <new> |
#include "circular-queue-inl.h" |
#include "profile-generator-inl.h" |
#include "unbound-queue-inl.h" |
@@ -62,23 +63,10 @@ void SharedFunctionInfoMoveEventRecord::UpdateCodeMap(CodeMap* code_map) { |
} |
-TickSampleEventRecord* TickSampleEventRecord::init(void* value) { |
- TickSampleEventRecord* result = |
- reinterpret_cast<TickSampleEventRecord*>(value); |
- result->filler = 1; |
- ASSERT(result->filler != SamplingCircularQueue::kClear); |
- // Init the required fields only. |
- result->sample.pc = NULL; |
- result->sample.frames_count = 0; |
- result->sample.has_external_callback = false; |
- return result; |
-} |
- |
- |
TickSample* ProfilerEventsProcessor::TickSampleEvent() { |
generator_->Tick(); |
TickSampleEventRecord* evt = |
- TickSampleEventRecord::init(ticks_buffer_.Enqueue()); |
+ new(ticks_buffer_.Enqueue()) TickSampleEventRecord(); |
evt->order = enqueue_order_; // No increment! |
return &evt->sample; |
} |