MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / set_runtime_table

Method set_runtime_table

crates/wasmtime/src/runtime/vm/component.rs:583–591  ·  view source on GitHub ↗

Stores the runtime table pointer at the index specified. This is intended to be called during the instantiation process of a component once a table is available, which may not be until part-way through component instantiation. Note that it should be a property of the component model that the `ptr` here is never needed prior to it being configured here in the instance.

(self: Pin<&mut Self>, idx: RuntimeTableIndex, import: VMTableImport)

Source from the content-addressed store, hash-verified

581 /// Note that it should be a property of the component model that the `ptr`
582 /// here is never needed prior to it being configured here in the instance.
583 pub fn set_runtime_table(self: Pin<&mut Self>, idx: RuntimeTableIndex, import: VMTableImport) {
584 unsafe {
585 let offset = self.offsets.runtime_table(idx);
586 let storage = self.vmctx_plus_offset_mut::<VMTableImport>(offset);
587 debug_assert!((*storage).vmctx.as_ptr() as usize == INVALID_PTR);
588 debug_assert!((*storage).from.as_ptr() as usize == INVALID_PTR);
589 *storage = import;
590 }
591 }
592
593 /// Configures host runtime lowering information associated with imported f
594 /// functions for the `idx` specified.

Callers 1

extract_tableMethod · 0.80

Calls 1

runtime_tableMethod · 0.45

Tested by

no test coverage detected