-
Notifications
You must be signed in to change notification settings - Fork 127
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
ffi:Pointer finalizer #53
Comments
dart:ffi supports GC finalizers now! |
Good to hear, let's see in what form it actually lands in Dart. There are some open issues still. |
The way this can be used already doesn't look so bad. If we could temporarily have a single That way we could get rid of all the close() calls already for 1.0. Later, when finalizers land in user-land dart, we can implement them properly and drop the native function. 🤔 |
Structs / Pointers are disallowed finalizers, due to potential use-after-freeing memory. It can still be used indirectly, I hope, by maintaing a memory address pool. |
I guess we're gonna wait how this turns out. With pointers out of the question, we wouldn't be able to use finalizers for what we need them. |
Another follow-up issue in dart SDK: https://github.com/dart-lang/sdk/issues/45455 |
I've ended up implementing this using the currently available finalizers and it works fine. |
We should track the development of this issue.
It might be available on the bleeding edge dart.
The text was updated successfully, but these errors were encountered: