Skip to content

fix: dead member, capacity checks, insert perf, napi_env by value#27

Merged
JonasBa merged 2 commits into
mainfrom
fix/native-bindings-improvements
Apr 30, 2026
Merged

fix: dead member, capacity checks, insert perf, napi_env by value#27
JonasBa merged 2 commits into
mainfrom
fix/native-bindings-improvements

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented Apr 30, 2026

Remove cpu stats and improve the accuracy of the capacity checks.

JonasBa and others added 2 commits April 29, 2026 19:44
…pass-by-value

- Remove unused `uv_cpu_info_t cpu_stats` member from MeasurementsTicker,
  initialize local pointer to nullptr in cpu_callback instead
- Replace `capacity()` checks in measurement callbacks with a
  `kMaxMeasurementSamples` constant — capacity can grow past reserve()
  so the old check was not a reliable cap
- Replace `vector::insert(begin() + index)` with `push_back()` in
  measurement callbacks — insertion is always at the end, push_back
  is O(1) vs O(n)
- Pass `napi_env` by value instead of const reference — it is a pointer
  typedef, so pass-by-ref adds unnecessary indirection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JonasBa JonasBa merged commit 8197ad0 into main Apr 30, 2026
66 checks passed
mydea added a commit to getsentry/sentry-javascript that referenced this pull request May 8, 2026
…4.0 (#20720)

Bumps this from 2.2.0 to 2.4.0, including the following changes:

## v2.4.0

* feat: Add Node 26 support
(getsentry/sentry-javascript-profiling-node-binaries#32)

## v2.3.0

* fix: Memory leaks, integer truncation, UB, and double-stop
(getsentry/sentry-javascript-profiling-node-binaries#26)
* fix: Integer arithmetic for timestamps, emit elapsed_since_start_ns as
string
(getsentry/sentry-javascript-profiling-node-binaries#28)
* fix: Dead member, capacity checks, insert perf, napi_env by value
(getsentry/sentry-javascript-profiling-node-binaries#27)
* chore: Replace execSync with execFileSync to prevent command injection
(getsentry/sentry-javascript-profiling-node-binaries#23)
* chore: Pin GitHub Actions to full-length commit SHAs
(getsentry/sentry-javascript-profiling-node-binaries#24)
* ci: Build Linux in container for wider glibc support
(getsentry/sentry-javascript-profiling-node-binaries#16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants