Skip to content

Commit

Permalink
Merge pull request #632 from hermit-os/dependabot/cargo/zerocopy-0.8
Browse files Browse the repository at this point in the history
build(deps): update zerocopy requirement from 0.7 to 0.8
  • Loading branch information
mkroening authored Oct 11, 2024
2 parents 338d7c5 + 0a14c4a commit 3584b4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/wasmtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ log = { version = "0.4" } #, features = ["kv_unstable"]}
simple_logger = { version = "5.0", default-features = false }
# FIXME: remove `gc` feature once upgraded to wasmtime 25:
wasmtime = { version = "24.0", default-features = false, features = ["std", "gc", "runtime", "cranelift", "threads", "parallel-compilation"] } #"pooling-allocator", "incremental-cache", "wat", "gc", "component-model"] }
zerocopy = { version = "0.7", default-features = false, features = ["alloc", "derive", "simd-nightly"] }
zerocopy = { version = "0.8", default-features = false, features = ["alloc", "derive", "simd-nightly"] }

[target.'cfg(target_os = "hermit")'.dependencies]
hermit = { path = "../../hermit", default-features = false, features = ["acpi", "pci", "fsgsbase", "fs", "tcp", "dhcpv4", "mmap"] }
Expand Down
14 changes: 7 additions & 7 deletions examples/wasmtime/src/preview1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use bitflags::bitflags;
use log::debug;
use wasi::*;
use wasmtime::{AsContext, AsContextMut, Caller, Extern};
use zerocopy::AsBytes;
use zerocopy::{Immutable, IntoBytes, KnownLayout};

static FD: Mutex<Vec<Descriptor>> = Mutex::new(Vec::new());

Expand Down Expand Up @@ -74,7 +74,7 @@ const SOCKET_STREAM: u8 = 1 << 5;
/// The file refers to a symbolic link inode.
const SYMBOLIC_LINK: u8 = 1 << 6;

#[derive(Debug, Copy, Clone, Default, AsBytes)]
#[derive(Debug, Copy, Clone, Default, IntoBytes, KnownLayout, Immutable)]
#[repr(C)]
pub(crate) struct FileStat {
pub dev: u64,
Expand All @@ -90,7 +90,7 @@ pub(crate) struct FileStat {
pub ctim: u64,
}

#[derive(Debug, Copy, Clone, Default, AsBytes)]
#[derive(Debug, Copy, Clone, Default, IntoBytes, KnownLayout, Immutable)]
#[repr(C)]
pub(crate) struct FdStat {
pub filetype: u8,
Expand Down Expand Up @@ -191,7 +191,7 @@ pub(crate) fn init<T>(linker: &mut wasmtime::Linker<T>) -> Result<()> {
let _ = mem.read(
caller.as_context_mut(),
path_ptr.try_into().unwrap(),
path.as_bytes_mut(),
path.as_mut_bytes(),
);
let path = "/".to_owned() + std::str::from_utf8(&path).unwrap();

Expand Down Expand Up @@ -250,7 +250,7 @@ pub(crate) fn init<T>(linker: &mut wasmtime::Linker<T>) -> Result<()> {
let _ = mem.read(
caller.as_context_mut(),
path_ptr.try_into().unwrap(),
path.as_bytes_mut(),
path.as_mut_bytes(),
);

let path = "/".to_owned() + std::str::from_utf8(&path).unwrap();
Expand Down Expand Up @@ -469,7 +469,7 @@ pub(crate) fn init<T>(linker: &mut wasmtime::Linker<T>) -> Result<()> {
let _ = mem.read(
caller.as_context(),
iovs_ptr.try_into().unwrap(),
iovs.as_bytes_mut(),
iovs.as_mut_bytes(),
);

let mut nread_bytes: i32 = 0;
Expand Down Expand Up @@ -594,7 +594,7 @@ pub(crate) fn init<T>(linker: &mut wasmtime::Linker<T>) -> Result<()> {
let _ = mem.read(
caller.as_context(),
iovs_ptr.try_into().unwrap(),
iovs.as_bytes_mut(),
iovs.as_mut_bytes(),
);

let mut nwritten_bytes: i32 = 0;
Expand Down

0 comments on commit 3584b4c

Please sign in to comment.