shekohex / allo-isolate

Run Multithreaded Rust along with Dart VM (in isolate) 🌀
Apache License 2.0
118 stars 17 forks source link

Directly find out Dart_PostCObject function pointer, instead of manually letting Dart to call Rust's store_dart_post_cobject? #10

Open fzyzcjy opened 3 years ago

fzyzcjy commented 3 years ago

Hi thanks for the lib! Looking at https://github.com/dart-lang/sdk/blob/master/runtime/include/dart_api_dl.h , I guess a C++ programmer will simply #include this header and then use the extern Dart_PostCObject_Type Dart_PostCObject_DL; directly. So what about removing store_dart_post_cobject and directly do that?

I can make a PR.

related: https://github.com/dart-lang/sdk/issues/47356

shekohex commented 3 years ago

can you explain more? what are you trying to achieve here?

fzyzcjy commented 3 years ago

I find it probably not feasible. So please ignore this issue until I get reply from the related dart sdk issue.

By the way, https://github.com/sunshine-protocol/allo-isolate/pull/12 is NOT the same as this issue. That PR is merely using a lib to remove a unsafe call.