Skip to content

Commit

Permalink
fix: small v8 memory leak, reuse profiling titles (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
seemk authored Dec 19, 2023
1 parent f299105 commit 43170de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/native_ext/profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 43170de

Please sign in to comment.