Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wiggle: copy guest strings from shared memory #5475

Merged
merged 2 commits into from
Jan 4, 2023

Commits on Jan 3, 2023

  1. wiggle: copy guest strings from shared memory

    Along the same lines as bytecodealliance#5471, this change adds a new smart pointer,
    `GuestStrCow`, to copy the string bytes over from Wasm memory to the
    host when the string is found in shared memory. This is necessary to
    maintain Rust guarantees: with shared memory, the bytes backing a
    `GuestStr` could be altered by another thread and this would invalidate
    the assumption that we can dereference at any point to `&str`.
    `GuestStrCow` is essentially a wrapper around `GuestStr` when the memory
    is not shared but copies the memory region into a `String` when the
    memory is shared.
    
    This change updates the uses of Wiggle strings in both wasi-common and
    wasi-crypto.
    abrown committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    f0e2c6a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4690bfb View commit details
    Browse the repository at this point in the history