mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 21:37:56 +00:00
Remove sandboxing host function interface (#12852)
* Remove sandboxing interface * Remove unused struct
This commit is contained in:
committed by
GitHub
parent
198faaa6f9
commit
32578cb010
@@ -48,24 +48,6 @@ pub fn into_wasmtime_val(value: Value) -> wasmtime::Val {
|
||||
}
|
||||
}
|
||||
|
||||
/// Read data from a slice of memory into a newly allocated buffer.
|
||||
///
|
||||
/// Returns an error if the read would go out of the memory bounds.
|
||||
pub(crate) fn read_memory(
|
||||
ctx: impl AsContext<Data = StoreData>,
|
||||
source_addr: Pointer<u8>,
|
||||
size: usize,
|
||||
) -> Result<Vec<u8>> {
|
||||
let range =
|
||||
checked_range(source_addr.into(), size, ctx.as_context().data().memory().data_size(&ctx))
|
||||
.ok_or_else(|| Error::Other("memory read is out of bounds".into()))?;
|
||||
|
||||
let mut buffer = vec![0; range.len()];
|
||||
read_memory_into(ctx, source_addr, &mut buffer)?;
|
||||
|
||||
Ok(buffer)
|
||||
}
|
||||
|
||||
/// Read data from the instance memory into a slice.
|
||||
///
|
||||
/// Returns an error if the read would go out of the memory bounds.
|
||||
|
||||
Reference in New Issue
Block a user