Allow transfer of Pointer
objects across isolates
#50715
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-ffi
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 aFinalizable
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
The text was updated successfully, but these errors were encountered: