From 189362db99dedb465599781598d0adfc19d5d30e Mon Sep 17 00:00:00 2001 From: Siim Kallas Date: Tue, 19 Dec 2023 10:53:57 +0200 Subject: [PATCH] fix: small v8 memory leak, reuse profiling titles --- src/native_ext/profiling.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/native_ext/profiling.cpp b/src/native_ext/profiling.cpp index edbfcc4a..6ce9c60d 100644 --- a/src/native_ext/profiling.cpp +++ b/src/native_ext/profiling.cpp @@ -379,6 +379,7 @@ NAN_METHOD(StartProfiling) { char title[64]; ProfileTitle(profiling->profilerSeq, title, sizeof(title)); + profiling->activationDepth = 0; profiling->startTime = HrTime(); profiling->wallStartTime = MicroSecondsSinceEpoch() * 1000L; @@ -610,7 +611,7 @@ NAN_METHOD(CollectProfilingData) { char prevTitle[64]; ProfileTitle(profiling->profilerSeq, prevTitle, sizeof(prevTitle)); - profiling->profilerSeq++; + profiling->profilerSeq = (profiling->profilerSeq + 1) % 2; char nextTitle[64]; ProfileTitle(profiling->profilerSeq, nextTitle, sizeof(nextTitle));