Deallocate the WasmSlice
(
&self,
slice: WasmSlice,
store: &mut Store<JavaState>,
)
| 121 | |
| 122 | /// Deallocate the WasmSlice |
| 123 | pub fn dealloc_bytes( |
| 124 | &self, |
| 125 | slice: WasmSlice, |
| 126 | store: &mut Store<JavaState>, |
| 127 | ) -> Result<(), Error> { |
| 128 | let ptr = slice.ptr(); |
| 129 | let len = slice.len(); |
| 130 | let mut no_result = [Val::null(); 0]; |
| 131 | self.dealloc |
| 132 | .call(store, &[Val::I32(ptr), Val::I32(len)], &mut no_result) |
| 133 | .with_context(|| anyhow!("failed to deallocate bytes"))?; |
| 134 | |
| 135 | debug!("Deallocated offset {} len {}", ptr, len); |
| 136 | Ok(()) |
| 137 | } |
| 138 | |
| 139 | pub fn alloc<T: Sized>( |
| 140 | &self, |