Skip to content

Allow transfer of Pointer objects across isolates #50715

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
mkustermann opened this issue Dec 14, 2022 · 1 comment
Closed

Allow transfer of Pointer objects across isolates #50715

mkustermann opened this issue Dec 14, 2022 · 1 comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi

Comments

@mkustermann
Copy link
Member

Our Pointer objects are no longer reified. We won't allow attaching finalizers to them. We may just represent them as unboxed integers in Dart.

Given that, it does seem reasonable we allow sending Pointer objects across isolates (since they are immutable, they can also be shared). If the message that is being sent includes a Finalizable we disallow sending the message anyway.

Currently people can still achieve it by taking pointer.address before sending and then re-construct the pointer on the other side.

(There's one caveat: If a message got sent but receiver dies or doesn't handle them, any messages are dropped. This dropping will not cause freeing of any memory (we have support on C side to do that, but not in SendPort api). But this problem seems orthogonal.)

/cc @mraleph @dcharkes

@mkustermann mkustermann added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi labels Dec 14, 2022
@dcharkes
Copy link
Contributor

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
Projects
None yet
Development

No branches or pull requests

2 participants