Stream: wasmtime

Topic: ✔ How to read/writ byte buffer to rust wasm from wasm-tim...


view this post on Zulip Kishan Adapa (Apr 11 2023 at 15:59):

Hi, I am trying to call a wasm binary from wasmtime-go and want to pass a byte buffer and receive a buffer in return. I wasn't able to navigate my self through it. Can some one help me do that?

I was following https://github.com/tetratelabs/wazero/tree/main/examples/allocation/rust as a reference, was able to do it in wazero but stuck trying to do the same in wasmtime -go. The allocate function seems to be returning a pointer address much larger than size of wasm buffer, in case of wazero it always was a direct mapping so that I can read/write from linear byte array

wazero: the zero dependency WebAssembly runtime for Go developers - wazero/examples/allocation/rust at main · tetratelabs/wazero

view this post on Zulip Kishan Adapa (Apr 11 2023 at 16:03):

in case of wazero it always was a direct mapping so that I can read/write from linear byte array

Rather I should say, using mod.Memory (of wazero) read/write of that variable succeeds. How achieve similar functionality in wasmtime?

view this post on Zulip Kishan Adapa (Apr 12 2023 at 03:42):

I realised I wasn't giving enough memory pages

view this post on Zulip Notification Bot (Apr 12 2023 at 03:42):

Kishan Adapa has marked this topic as resolved.


Last updated: Nov 22 2024 at 17:03 UTC