Skip to content

[vm/ffi] Expose Dart_TypedDataAcquireData and Dart_TypedDataReleaseData in dart_api_dl.h #44442

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

Closed
dcharkes opened this issue Dec 10, 2020 · 3 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi type-enhancement A request for a change that isn't a bug

Comments

@dcharkes
Copy link
Contributor

dcharkes commented Dec 10, 2020

To enable copy-free access of Uint8List in native code through Object -> Dart_Handle in trampolines we should expose Dart_TypedDataAcquireData and Dart_TypedDataReleaseData in dart_api_dl.h so that those symbols are available in Flutter.

Background: https://stackoverflow.com/questions/65194980/search-for-sequence-in-uint8list
Background: #40607

@dcharkes dcharkes added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi labels Dec 10, 2020
@mraleph
Copy link
Member

mraleph commented Dec 10, 2020

I would suggest not to expose them if possible. Instead we should prefer implementing typed data -> pointer unwrapping on leaf calls.

@dcharkes
Copy link
Contributor Author

dcharkes commented Dec 10, 2020

I agree that would be the cleaner solution. #36707 cc @lrhn

@mkustermann mkustermann added the type-enhancement A request for a change that isn't a bug label Dec 16, 2020
@dcharkes
Copy link
Contributor Author

dcharkes commented Jan 5, 2021

I filed #44589 to implement @mraleph's suggestion instead.

@dcharkes dcharkes closed this as completed Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants