bytecodealliance / bytecodealliance/wasmtime

Allow slices of more types than `u8` in wiggle

Open
#9,319 0 comments 0 reactions 0 assignees View on GitHub
wiggle
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

#### Feature

The `GuestMemory::as_slice` method should allow slices of types other than `u8` to be constructed. It's currently possible to work around this by using the `GuestMemory::to_vec` method, which is appropriately parameterized, but it would be nice to read slices of types like `u32` without having to copy all the values back into the host.

#### Benefit

This change woudl result in a slight memory savings for cases where you don't need the entire vector to be present in host memory.

#### Alternatives

We can certainly leave things as they are, as it's always possible to fall back on `GuestMemory::to_vec`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.