Skip to content

Commit

Permalink
fix(api) Remove the temporary Memory::uint8 method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Aug 30, 2021
1 parent bb47a47 commit 347f4c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions lib/api/src/sys/externals/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@ impl Memory {
unsafe { MemoryView::new(base as _, length as u32) }
}

/// A uint8view
pub fn uint8view(&self) -> MemoryView<u8> {
self.view()
}

pub(crate) fn from_vm_export(store: &Store, vm_memory: VMMemory) -> Self {
Self {
store: store.clone(),
Expand Down
4 changes: 2 additions & 2 deletions lib/wasi/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fn read_bytes<T: Read>(
bytes_read += reader.read(&mut raw_bytes).map_err(|_| __WASI_EIO)? as u32;
unsafe {
memory
.uint8view()
.view::<u8>()
.subarray(
iov_inner.buf as u32,
iov_inner.buf as u32 + iov_inner.buf_len as u32,
Expand Down Expand Up @@ -2530,7 +2530,7 @@ pub fn random_get(env: &WasiEnv, buf: u32, buf_len: u32) -> __wasi_errno_t {
Ok(()) => {
unsafe {
memory
.uint8view()
.view::<u8>()
.subarray(buf as u32, (buf as u32 + buf_len as u32))
.copy_from(&u8_buffer);
}
Expand Down

0 comments on commit 347f4c6

Please sign in to comment.