Skip to content

Commit

Permalink
Add a runtime_module method to get the wasmtime::Module associate…
Browse files Browse the repository at this point in the history
…d with a `wasmtime::runtime::vm::Instance` (#9268)
  • Loading branch information
fitzgen authored Sep 17, 2024
1 parent dc97fe0 commit c74a7b7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/wasmtime/src/runtime/vm/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,18 @@ impl Instance {
.cast()
}

pub(crate) fn env_module(&self) -> &Arc<Module> {
pub(crate) fn env_module(&self) -> &Arc<wasmtime_environ::Module> {
self.runtime_info.env_module()
}

#[allow(dead_code)] // TODO: used in forthcoming patches
pub(crate) fn runtime_module(&self) -> Option<&crate::Module> {
match &self.runtime_info {
ModuleRuntimeInfo::Module(m) => Some(m),
ModuleRuntimeInfo::Bare(_) => None,
}
}

/// Translate a module-level interned type index into an engine-level
/// interned type index.
pub fn engine_type_index(&self, module_index: ModuleInternedTypeIndex) -> VMSharedTypeIndex {
Expand Down

0 comments on commit c74a7b7

Please sign in to comment.