From 43170dee94bb5dffc45b99e8fc78099e9534296c Mon Sep 17 00:00:00 2001 From: Siim Kallas Date: Tue, 19 Dec 2023 11:20:42 +0200 Subject: [PATCH] fix: small v8 memory leak, reuse profiling titles (#858) --- 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));