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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ext/ffi): add support for buffer arguments #12335
feat(ext/ffi): add support for buffer arguments #12335
Changes from 27 commits
5d71bc8
24a13d4
746f8be
6c775fb
1f92c47
b73e4b6
2a9f0da
e080158
e716539
39e5e37
4d132fa
838a94c
5f4d9d4
fc34425
b88f389
2f1ac45
9bb4271
32cc817
b2c622f
f7bdcd3
2d659e8
5587fbd
9483ca7
efd5e8c
93bef64
6e5d988
3f339a3
84ac1a5
067b136
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit unhandy... I wonder if we could just sniff out length automatically in case of
ArrayBuffer
. Though I think users would still have to declare two parameters... @piscisaureus thoughts?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible of course to sniff out the length automatically on the JS/Rust side (for Uint8Array too, btw).
However C has no standard data type for passing a (pointer, length) tuple.
So I'd just leave it as-is, FFI users can provide their own convenience wrappers.