★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/f570c19c89Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files

perf_hooks: avoid memory leak on gc observer

Fixes: #22229

PR-URL: #22241
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: George Adams <george.adams@uk.ibm.com>
  • Loading branch information...
jasnell authored and rvagg committed Aug 10, 2018
1 parent 1afcea1 commit f570c19c89710cd33455714ce9110ff4e838867e
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/node_perf.cc
@@ -272,6 +272,9 @@ void MarkGarbageCollectionEnd(Isolate* isolate,
v8::GCCallbackFlags flags,
void* data) {
Environment* env = static_cast<Environment*>(data);
// If no one is listening to gc performance entries, do not create them.
if (!env->performance_state()->observers[NODE_PERFORMANCE_ENTRY_TYPE_GC])
return;
GCPerformanceEntry* entry =
new GCPerformanceEntry(env,
static_cast<PerformanceGCKind>(type),

0 comments on commit f570c19

Please sign in to comment.
You can’t perform that action at this time.