mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 04:37:57 +00:00
Opt-out from fast instance reuse and foundation for other refactorings (#8394)
* Establish the runtime_blob module Seed it with the existing contents of the `util` module. * Port wasmtime mutable globals instrumentation into runtime blob APIs * Opt-out from fast instance reuse * Minor clean up * Spaces * Docs clean up * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Factor out the expects * Fix the suggestion Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -300,14 +300,22 @@ pub fn create_wasm_runtime_with_code(
|
||||
.map(|runtime| -> Arc<dyn WasmModule> { Arc::new(runtime) })
|
||||
}
|
||||
#[cfg(feature = "wasmtime")]
|
||||
WasmExecutionMethod::Compiled =>
|
||||
WasmExecutionMethod::Compiled => {
|
||||
let blob = sc_executor_common::runtime_blob::RuntimeBlob::new(code)?;
|
||||
sc_executor_wasmtime::create_runtime(
|
||||
code,
|
||||
heap_pages,
|
||||
sc_executor_wasmtime::CodeSupplyMode::Verbatim { blob },
|
||||
sc_executor_wasmtime::Config {
|
||||
heap_pages: heap_pages as u32,
|
||||
allow_missing_func_imports,
|
||||
cache_path: cache_path.map(ToOwned::to_owned),
|
||||
semantics: sc_executor_wasmtime::Semantics {
|
||||
fast_instance_reuse: true,
|
||||
stack_depth_metering: false,
|
||||
},
|
||||
},
|
||||
host_functions,
|
||||
allow_missing_func_imports,
|
||||
cache_path,
|
||||
).map(|runtime| -> Arc<dyn WasmModule> { Arc::new(runtime) }),
|
||||
).map(|runtime| -> Arc<dyn WasmModule> { Arc::new(runtime) })
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user