Hi, I have a Rust function I'm wrapping that needs access to the caller's memory. One of the arguments to the function is a guest pointer (not in the wiggle sense, but a raw u32
). Right now I'm storing the Memory
in the WasiCtx
table
to be looked up through the Caller
I receive as a parameter. This seems like a hack, though. Is there a better way to go about this? Instantiation order (the instance is exporting the memory) means I can't pass it in through the closure.
I think the last example here might help https://docs.rs/wasmtime/latest/wasmtime/struct.Func.html#examples-2
Thanks @Alex Crichton . :weary: I don't know how I missed the get_export
function on Caller
.
Braden McDorman has marked this topic as resolved.
Last updated: Nov 22 2024 at 16:03 UTC