-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Avoid manual memory management with JSClosure #106
Labels
enhancement
New feature or request
Comments
Turns out LLVM does have it in some state as introduced in llvm/llvm-project@79aad89. |
IIRC the issue with JSClosure is that when passed to JS APIs, the Swift closure is deallocated early. We could manage this by using a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wonder if reference types could lift our requirement to manage references to JS closures manually?
This means that JS closures should be passed to the Swift code as
externref
. Deallocating all references toexternref
would deallocate the closure on the JS side.Reference types are now available in all browsers except Safari, and in the latter case they seem to only be hidden behind
JSC_useWebAssemblyReferences
flag. The only question isexternref
support in our toolchain...Doesn't look like LLVM had much progress in that direction? 🤔 Also see WebAssembly/tool-conventions#122
The text was updated successfully, but these errors were encountered: