Skip to content

src: simplify and fix FFI ArrayBuffer accesses#62857

Open
addaleax wants to merge 2 commits intonodejs:mainfrom
addaleax:ffi-ab-access
Open

src: simplify and fix FFI ArrayBuffer accesses#62857
addaleax wants to merge 2 commits intonodejs:mainfrom
addaleax:ffi-ab-access

Conversation

@addaleax
Copy link
Copy Markdown
Member

ArrayBufferViewContents supports ArrayBuffers, so we do not need to provide special treatment for those.

Also, small typed arrays may not have backing stores until their corresponding ArrayBuffers are accessed, so do that in order to avoid accidentally accessing arbitrary stack memory.

`ArrayBufferViewContents` supports `ArrayBuffer`s, so we do not
need to provide special treatment for those.

Also, small typed arrays may not have backing stores until their
corresponding `ArrayBuffer`s are accessed, so do that in order
to avoid accidentally accessing arbitrary stack memory.

Signed-off-by: Anna Henningsen <anna@addaleax.net>
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Apr 20, 2026
@addaleax addaleax added the ffi Issues and PRs related to experimental Foreign Function Interface support. label Apr 20, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.62%. Comparing base (e02087c) to head (b6651d8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ffi/data.cc 65.00% 2 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62857      +/-   ##
==========================================
- Coverage   89.64%   89.62%   -0.03%     
==========================================
  Files         706      706              
  Lines      219137   219124      -13     
  Branches    41999    41981      -18     
==========================================
- Hits       196453   196386      -67     
- Misses      14574    14619      +45     
- Partials     8110     8119       +9     
Files with missing lines Coverage Δ
src/ffi/data.cc 73.63% <65.00%> (+0.34%) ⬆️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@addaleax addaleax requested a review from ShogunPanda April 20, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants