Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2018-02-26 01:26:22 +0300
committerJames M Snell <jasnell@gmail.com>2018-03-06 18:50:01 +0300
commit9256dbb6115021fb69d5ccc2af0f7e27b0601007 (patch)
tree9127d1ce78731e3ff76f21517fb5c2b0162b0636 /src/node_perf_common.h
parentad721429c02a086373d841206927718048d6b521 (diff)
perf_hooks: fix timing
Fixes: https://github.com/nodejs/node/issues/17892 Fixes: https://github.com/nodejs/node/issues/17893 Fixes: https://github.com/nodejs/node/issues/18992 PR-URL: https://github.com/nodejs/node/pull/18993 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'src/node_perf_common.h')
-rw-r--r--src/node_perf_common.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/node_perf_common.h b/src/node_perf_common.h
index 435a4cffe5a..7ff57359ba5 100644
--- a/src/node_perf_common.h
+++ b/src/node_perf_common.h
@@ -4,6 +4,7 @@
#include "node.h"
#include "v8.h"
+#include <algorithm>
#include <map>
#include <string>
@@ -76,7 +77,10 @@ class performance_state {
isolate,
offsetof(performance_state_internal, observers),
NODE_PERFORMANCE_ENTRY_TYPE_INVALID,
- root) {}
+ root) {
+ for (size_t i = 0; i < milestones.Length(); i++)
+ milestones[i] = -1.;
+ }
AliasedBuffer<uint8_t, v8::Uint8Array> root;
AliasedBuffer<double, v8::Float64Array> milestones;