mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-28 06:29:49 +00:00
Adds a test to ensure that we clear the heap between calls into runtime (#4903)
* Adds a test to ensure that we clear the heap between calls into runtime The tests shows that we currently not clearing the heap in wasmtime. For now we don't run the test for wasmtime. * Fix compilation
This commit is contained in:
1 parent
78b5a06200
commit
d3fa8c91af
6 files changed
+81
-4
No files matched your search
@@ -669,6 +669,19 @@ impl WasmRuntime for WasmiRuntime {
|
||||
&self.missing_functions,
|
||||
)
|
||||
}
|
||||
|
||||
fn get_global_val(&self, name: &str) -> Result<Option<sp_wasm_interface::Value>, Error> {
|
||||
match self.instance.export_by_name(name) {
|
||||
Some(global) => Ok(Some(
|
||||
global
|
||||
.as_global()
|
||||
.ok_or_else(|| format!("`{}` is not a global", name))?
|
||||
.get()
|
||||
.into()
|
||||
)),
|
||||
None => Ok(None),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_instance(
|
||||
|
||||
Reference in new issue
Block a user