This commit is contained in:
Lachlan Sneff
2019-04-09 16:07:09 -07:00
parent c212ba3619
commit 0745274892
3 changed files with 22 additions and 0 deletions

View File

@ -72,6 +72,16 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
unsafe impl<T: Copy, Ty> WasmExternType for WasmPtr<T, Ty> {
const TYPE: Type = Type::I32;
fn to_bits(self) -> u64 {
self.offset as u64
}
fn from_bits(n: u64) -> Self {
Self {
offset: n as u32,
_phantom: PhantomData,
}
}
}
unsafe impl<T: Copy, Ty> ValueType for WasmPtr<T, Ty> {}