mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
Optimized ModuleInfo usage
This commit is contained in:
@@ -4,6 +4,7 @@ use crate::{Features, MemoryIndex, MemoryStyle, ModuleInfo, TableIndex, TableSty
|
||||
use rkyv::{Archive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize};
|
||||
#[cfg(feature = "enable-serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// The required info for compiling a module.
|
||||
///
|
||||
@@ -16,7 +17,7 @@ pub struct CompileModuleInfo {
|
||||
/// The features used for compiling the module
|
||||
pub features: Features,
|
||||
/// The module information
|
||||
pub module: ModuleInfo,
|
||||
pub module: Arc<ModuleInfo>,
|
||||
/// The memory styles used for compiling.
|
||||
///
|
||||
/// The compiler will emit the most optimal code based
|
||||
|
||||
@@ -128,7 +128,12 @@ impl SerializableModule {
|
||||
|
||||
/// Create a `ModuleInfo` for instantiation
|
||||
pub fn create_module_info(&self) -> ModuleInfo {
|
||||
self.compile_info.module.clone()
|
||||
self.compile_info.module.as_ref().clone()
|
||||
}
|
||||
|
||||
/// Returns the `ModuleInfo` for instantiation
|
||||
pub fn module_info(&self) -> &ModuleInfo {
|
||||
&self.compile_info.module
|
||||
}
|
||||
|
||||
/// Returns the features for this Artifact
|
||||
|
||||
Reference in New Issue
Block a user