mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 06:31:09 +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:
@@ -36,7 +36,7 @@ use sc_executor_common::{
|
||||
error::{Error, WasmError},
|
||||
sandbox,
|
||||
};
|
||||
use sc_executor_common::util::{DataSegmentsSnapshot, WasmModuleInfo};
|
||||
use sc_executor_common::runtime_blob::{RuntimeBlob, DataSegmentsSnapshot};
|
||||
|
||||
struct FunctionExecutor<'a> {
|
||||
sandbox_store: sandbox::Store<wasmi::FuncRef>,
|
||||
@@ -661,11 +661,8 @@ pub fn create_runtime(
|
||||
)
|
||||
.map_err(|e| WasmError::Instantiation(e.to_string()))?;
|
||||
|
||||
let data_segments_snapshot = DataSegmentsSnapshot::take(
|
||||
&WasmModuleInfo::new(code)
|
||||
.ok_or_else(|| WasmError::Other("cannot deserialize module".to_string()))?,
|
||||
)
|
||||
.map_err(|e| WasmError::Other(e.to_string()))?;
|
||||
let data_segments_snapshot = DataSegmentsSnapshot::take(&RuntimeBlob::new(code)?)
|
||||
.map_err(|e| WasmError::Other(e.to_string()))?;
|
||||
let global_vals_snapshot = GlobalValsSnapshot::take(&instance);
|
||||
|
||||
(data_segments_snapshot, global_vals_snapshot)
|
||||
|
||||
Reference in New Issue
Block a user