mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
remove faulty instance
This commit is contained in:
parent
f8809a3eef
commit
b3b2e7de11
1 changed files with 0 additions and 20 deletions
|
@ -113,26 +113,6 @@ impl<T: FromWasm32Memory + Clone> FromWasm32Memory for RocList<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: FromWasm32Memory + Clone> FromWasm32Memory for &'_ [T] {
|
|
||||||
const SIZE_OF_WASM: usize = 8;
|
|
||||||
const ALIGN_OF_WASM: usize = 4;
|
|
||||||
|
|
||||||
fn decode(memory: &wasmer::Memory, offset: u32) -> Self {
|
|
||||||
let bytes = <u64 as FromWasm32Memory>::decode(memory, offset);
|
|
||||||
|
|
||||||
let length = (bytes >> 32) as u32;
|
|
||||||
let elements = bytes as u32;
|
|
||||||
|
|
||||||
let ptr: wasmer::WasmPtr<u8, wasmer::Array> = wasmer::WasmPtr::new(elements);
|
|
||||||
let width = <T as FromWasm32Memory>::SIZE_OF_WASM as u32 * length;
|
|
||||||
let foobar = (ptr.deref(memory, 0, width)).unwrap();
|
|
||||||
let wasm_slice =
|
|
||||||
unsafe { std::slice::from_raw_parts(foobar as *const _ as *const _, length as usize) };
|
|
||||||
|
|
||||||
wasm_slice
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T: FromWasm32Memory> FromWasm32Memory for &'_ T {
|
impl<T: FromWasm32Memory> FromWasm32Memory for &'_ T {
|
||||||
const SIZE_OF_WASM: usize = 4;
|
const SIZE_OF_WASM: usize = 4;
|
||||||
const ALIGN_OF_WASM: usize = 4;
|
const ALIGN_OF_WASM: usize = 4;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue