Closed deadprogram closed 7 months ago
@orsinium I will look into that possibility more fully. However, I think that there is not yet anything exposing that to the guest side in TinyGo.
After reading a bit more, I think we should not base providing this capability on table implementation of externref
.
Most actual use cases in the wild I could find receive an externref
back from some host function, and then just use as a param when calling other host functions.
Separately, I added a more random way to generate a new reference ID.
I'm curious to see where and how Remove will be called. It's easy to leak the references.
I'm curious to see where and how Remove will be called. It's easy to leak the references.
Likewise. Let's find out...
In similar spirit to #6 this PR introduces
ExternalReferences
type to manage external references managed by host, but used from guest modules.This would be the host side:
The guest side: