Struct wasmtime_runtime::VMContext
source · [−]#[repr(C, align(16))]pub struct VMContext {
pub _marker: PhantomPinned,
}
Expand description
The VM “context”, which is pointed to by the vmctx
arg in Cranelift.
This has information about globals, memories, tables, and other runtime
state associated with the current instance.
The struct here is empty, as the sizes of these fields are dynamic, and we can’t describe them in Rust’s type system. Sufficient memory is allocated at runtime.
Fields
_marker: PhantomPinned
There’s some more discussion about this within wasmtime/src/lib.rs
but
the idea is that we want to tell the compiler that this contains
pointers which transitively refers to itself, to suppress some
optimizations that might otherwise assume this doesn’t exist.
The self-referential pointer we care about is the *mut Store
pointer
early on in this context, which if you follow through enough levels of
nesting, eventually can refer back to this VMContext
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for VMContext
impl Send for VMContext
impl Sync for VMContext
impl !Unpin for VMContext
impl UnwindSafe for VMContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more