Skip to content

ffi: avoid mutable push on private arrays - #67895

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
rozzilla:ffi-private-arrays-no-push
Dec 3, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
rozzilla:ffi-private-arrays-no-push

Conversation

@rozzilla

Copy link
Copy Markdown
Contributor

The shared-buffer and fast API wrappers for FFI functions collected per-argument type info, offsets and indexes with .push() on private arrays.

No tests are added because the three lines are already reached by the existing test/ffi tests (for example test-ffi-shared-buffer.js and test-ffi-fast-integer-validation.js).

Same approach as #67748, #67751 and #67752: private arrays only, no
performance claim.

The shared-buffer and fast API wrappers collected per-argument type
info, offsets and indexes with .push() on private arrays, which looks
up Array.prototype.push at call time. Replacing that method from user
code changed how wrapped functions were built. Use indexed assignments
instead.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
@nodejs-github-bot nodejs-github-bot added ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run. labels Nov 30, 2026
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.59%. Comparing base (91f8170) to head (4fd8c54).
⚠️ Report is 61 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #67895   +/-   ##
=======================================
  Coverage   90.58%   90.59%           
=======================================
  Files         802      802           
  Lines      286659   286659           
  Branches    55370    55368    -2     
=======================================
+ Hits       259676   259693   +17     
+ Misses      17083    17074    -9     
+ Partials     9900     9892    -8     
Files with missing lines Coverage Δ
lib/internal/ffi-shared-buffer.js 60.11% <100.00%> (ø)
lib/internal/ffi/fast-api.js 96.12% <100.00%> (ø)

... 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.

@daeyeon daeyeon added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Dec 3, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 3, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@gurgunday gurgunday added the commit-queue PRs queued for automated landing through the Commit Queue. label Dec 3, 2026
@nodejs-github-bot
nodejs-github-bot merged commit b471f26 into nodejs:main Dec 3, 2026
80 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in b471f26

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. 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.

5 participants