ffi: support Symbol.dispose on DynamicLibrary#62925
Open
mcollina wants to merge 1 commit intonodejs:mainfrom
Open
ffi: support Symbol.dispose on DynamicLibrary#62925mcollina wants to merge 1 commit intonodejs:mainfrom
mcollina wants to merge 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
bengl
reviewed
Apr 24, 2026
| toArrayBuffer, | ||
| } = internalBinding('ffi'); | ||
|
|
||
| ObjectDefineProperty(DynamicLibrary.prototype, SymbolDispose, { |
Member
There was a problem hiding this comment.
Why not just do a normal assignment here? That seems to be the norm in the rest of the codebase. (e.g. Timers, ChildProcess, Readline)
bengl
approved these changes
Apr 24, 2026
ShogunPanda
approved these changes
Apr 24, 2026
addaleax
approved these changes
Apr 24, 2026
Collaborator
Member
Author
|
Commit not validating due to nodejs/core-validate-commit#146 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62925 +/- ##
==========================================
- Coverage 91.48% 89.64% -1.85%
==========================================
Files 358 708 +350
Lines 151574 220385 +68811
Branches 23917 42272 +18355
==========================================
+ Hits 138674 197573 +58899
- Misses 12624 14678 +2054
- Partials 276 8134 +7858
🚀 New features to boost your workflow:
|
Collaborator
Contributor
|
@mcollina You're now missing a Signed-Off. once you add I'll approve and merge. |
6da4424 to
3ea2ef6
Compare
ShogunPanda
approved these changes
Apr 27, 2026
Collaborator
Collaborator
3ea2ef6 to
aacdb0d
Compare
ShogunPanda
approved these changes
Apr 28, 2026
Collaborator
Install [Symbol.dispose]() on DynamicLibrary.prototype (calling close()) and on the object returned from ffi.dlopen(), so both can be used with the `using` declaration for automatic cleanup. Signed-off-by: Matteo Collina <hello@matteocollina.com>
aacdb0d to
a0f4a8a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Install
Symbol.disposeonDynamicLibrary.prototype(callingclose()) and on the object returned fromffi.dlopen(), so both can be used with theusingdeclaration for automatic cleanup.