mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-12 08:31:21 +00:00
Added cache into standalone app
This commit is contained in:
@ -67,7 +67,6 @@ struct ArtifactHeader {
|
||||
magic: [u8; 8], // [W, A, S, M, E, R, \0, \0]
|
||||
version: u64,
|
||||
data_len: u64,
|
||||
wasm_hash: [u8; 32], // Sha256 of the wasm in binary format.
|
||||
}
|
||||
|
||||
impl ArtifactHeader {
|
||||
@ -170,7 +169,6 @@ impl Artifact {
|
||||
magic: WASMER_CACHE_MAGIC,
|
||||
version: CURRENT_CACHE_VERSION,
|
||||
data_len: 0,
|
||||
wasm_hash: self.inner.info.wasm_hash.into_array(),
|
||||
};
|
||||
|
||||
let mut buffer = cache_header.as_slice().to_vec();
|
||||
@ -195,5 +193,5 @@ pub trait Cache {
|
||||
type StoreError;
|
||||
|
||||
fn load(&self, key: WasmHash) -> Result<Module, Self::LoadError>;
|
||||
fn store(&mut self, module: Module) -> Result<WasmHash, Self::StoreError>;
|
||||
fn store(&mut self, key: WasmHash, module: Module) -> Result<(), Self::StoreError>;
|
||||
}
|
||||
|
@ -56,8 +56,6 @@ pub struct ModuleInfo {
|
||||
|
||||
pub namespace_table: StringTable<NamespaceIndex>,
|
||||
pub name_table: StringTable<NameIndex>,
|
||||
|
||||
pub wasm_hash: WasmHash,
|
||||
}
|
||||
|
||||
/// A compiled WebAssembly module.
|
||||
@ -116,6 +114,14 @@ impl Module {
|
||||
}
|
||||
}
|
||||
|
||||
impl Clone for Module {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
inner: Arc::clone(&self.inner),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ModuleInner {}
|
||||
|
||||
#[doc(hidden)]
|
||||
|
@ -565,8 +565,6 @@ mod vm_ctx_tests {
|
||||
|
||||
namespace_table: StringTable::new(),
|
||||
name_table: StringTable::new(),
|
||||
|
||||
wasm_hash: WasmHash::generate(&[]),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user