Skip to content

wasi-common / wiggle support for disjoint host/guest memory #7776

Open
@juntyr

Description

@juntyr

I am running WASI code in Wasmtime and the browser and am trying to reuse my WasiCtx implementation for both. While the Wasmtime host can access the guest's memory, which wiggle exposes by requiring a GuestMemory::base method implementation. In my browser use case, however, the "host" runs inside WASM itself and launches new guests as separate WASM instances. The backing memory for each instance, an ArrayBuffer, is disjoint, so any memory transfer has to go through copying read and write calls.

Feature

Would it be (or is it already) possible to generalise the GuestMemory trait to allow for guest memory implementations which are disjoint? If the GuestMemory::base method is required by current Wasmtime(-adjacen) code, it could be moved into an extension trait implemented by all current implementations.

Benefit

This more general approach would allow further code reuse even on platforms where the WASM host cannot directly access a guest's memory.

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions