alexcrichton commented on issue #3291:
It's worth pointing out that one refactoring I actually tried out was "what if we used
Pin<Box<StoreInner<T>>>
? I actually got pretty far with this but there's a few reasons that I didn't commit to it:
Primarily, I don't think
Pin
is the right abstraction. My goal is to represent how when you havePin<&mut StoreInner<T>>
orPin<&mut StoreOpaque>
you have to be careful about accessing the contents and not overwrite the entire structure. I misunderstood the guarantees ofPin
, though. ThePin::set
method is safe and allows, at any time, overwriting the contents of the pinned pointer. That means that whatever gymnastics we go through to usePin
doesn't actually provide us any more safety since it's still possibly to safely cause bad behavior.Otherwise
Pin
was primarily pretty unergonomic. The main point against it was that, as we do today, we are required to manually reborrowPin
every time it's passed around and used twice.So basically the ergonomic drop plus not actually providing much benefit led me to the conclusion that we simply need to continue to be vigilant within Wasmtime to do the right thing. We do still need the
PhantomPinned
, though, I think. I'm at least somewhat sure that we can't be marking all our pointers asnoalias
with all the aliasing we actually have...
github-actions[bot] commented on issue #3291:
Subscribe to Label Action
cc @peterhuene
<details>
This issue or pull request has been labeled: "wasmtime:api"Thus the following users have been cc'd because of the following labels:
- peterhuene: wasmtime:api
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
Last updated: Dec 23 2024 at 13:07 UTC