Skip to content

ffi: support SharedArrayBuffer in getRawPointer - #64864

Open
ganjanggejang wants to merge 1 commit into
nodejs:mainfrom
ganjanggejang:ffi-getrawpointer
Open

ffi: support SharedArrayBuffer in getRawPointer#64864
ganjanggejang wants to merge 1 commit into
nodejs:mainfrom
ganjanggejang:ffi-getrawpointer

Conversation

@ganjanggejang

Copy link
Copy Markdown
Contributor

Add test coverage and documentation for ffi.getRawPointer() support for SharedArrayBuffer.

getRawPointer() already supported SharedArrayBuffer sources, but this behavior was not covered by tests or documented.

Note:

symbols.pointer_to_usize(sharedArrayBuffer) is not used in this test because it goes through the FFI pointer argument conversion path. The current implementation in src/ffi/types.cc only handles ArrayBuffer for pointer arguments and does not support SharedArrayBuffer.

Signed-off-by: Junsoo Ha <junsoo2018@naver.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/ffi

@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 Jul 31, 2026

@ShogunPanda ShogunPanda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.17%. Comparing base (bec3d0b) to head (7ebfdb7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ffi/data.cc 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64864      +/-   ##
==========================================
+ Coverage   90.14%   90.17%   +0.02%     
==========================================
  Files         746      746              
  Lines      242763   242764       +1     
  Branches    45761    45762       +1     
==========================================
+ Hits       218848   218919      +71     
+ Misses      15402    15322      -80     
- Partials     8513     8523      +10     
Files with missing lines Coverage Δ
src/ffi/data.cc 73.99% <75.00%> (+0.50%) ⬆️

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

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++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants