-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
provide helpers (or samples) for zero-overhead non-leaking bytes transfer between isolates in ffi #47270
Comments
After carefully reading the doc, I find that the example above seems incomplete. Please correct me if I am wrong.
Thus, maybe should add an extra
|
@fzyzcjy good point, I have forgotten that |
It also would be nice to note why we have both |
@rustonaut I guess |
Thanks, I wasn't sure if If it's "just a void pointer passed to the finalizer" that would be grate as it would allow me to remove one indirection and simplify the usage in dart, too 👍 |
Users struggle to find effecient ways to pass large buffers of data around without either leaking them or copying them multiple times. We should consider providing some primitives and/or samples in FFI.
A common question is: my worker isolate produced large data array which I am holding by a pointer - how do I send it to main isolate without copying or leaking it?
The best answer right now is to use
Dart_PostCObject
to send it as an external typed data and simultaneously assign a finalizer to it - but this approach is not very discoverable. We could consider adding samples or helpers for it.The text was updated successfully, but these errors were encountered: