Stream: git-wasmtime

Topic: wasmtime / issue #8940 Tidy up `unchecked_try_gc_ref` met...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 11 2024 at 16:46):

fitzgen opened issue #8940:

Performing a GC requires &mut though, right? So given &StoreOpaque that's static proof that a GC won't happen?

Musing though: because unchecked_try_gc_ref returns a lifetime bound to &StoreOpaque doesn't that mean that GC is already statically disallowed while we're working with the gc_ref? If that's the case could the unchecked_ prefix be removed? (fine to defer this to a future PR of course)

_Originally posted by @alexcrichton in https://github.com/bytecodealliance/wasmtime/pull/8933#discussion_r1674184310_

Note: we can't just remove the unchecked_ prefix, since there are versions of this method already named those things, but they take a AutoAssertNoGc instead of a `&StoreOpaque. So it isn't clear what naming conventions we want to have here. Or we could make a trait that represents stores/contexts where we can rest assured that GC won't happen while that store/context type exists.

Feel free to bikeshed.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 12 2024 at 22:33):

alexcrichton closed issue #8940:

Performing a GC requires &mut though, right? So given &StoreOpaque that's static proof that a GC won't happen?

Musing though: because unchecked_try_gc_ref returns a lifetime bound to &StoreOpaque doesn't that mean that GC is already statically disallowed while we're working with the gc_ref? If that's the case could the unchecked_ prefix be removed? (fine to defer this to a future PR of course)

_Originally posted by @alexcrichton in https://github.com/bytecodealliance/wasmtime/pull/8933#discussion_r1674184310_

Note: we can't just remove the unchecked_ prefix, since there are versions of this method already named those things, but they take a AutoAssertNoGc instead of a `&StoreOpaque. So it isn't clear what naming conventions we want to have here. Or we could make a trait that represents stores/contexts where we can rest assured that GC won't happen while that store/context type exists.

Feel free to bikeshed.


Last updated: Dec 23 2024 at 13:07 UTC