fitzgen opened issue #11317:
A
DefinedInstanceis exactly likeInstancebut it only provides access to defined tables/memories/globals/etc...This would allow us to make splitting a mutable store borrow into multiple mutable (defined!) instance borrows safe because you couldn't access the imported entities that could alias defined items from another instance that could also be mutably borrowed. That is, this method (and any others we might eventually add like it) would no longer need to be
unsafeas long as it yieldedDefinedInstances instead ofInstances:To cut down on code duplication, we would probably want an
Instanceto deref to aDefinedInstanceor something like that. ProbablyInstancewould be a newtype ofDefinedInstancethat has methods for accessing imported items and anything that accesses that stuff, and then it also derefs to its innerDefinedInstance.cc @alexcrichton
fitzgen added the wasmtime:unsafe-code label to Issue #11317.
Last updated: Dec 06 2025 at 07:03 UTC