Replies: 1 comment 2 replies
-
Maybe I misunderstood what you are saying but the mentioned API should do the job already, right?
I guess this is the problem. So you have to make it so the Wasm uses host provided memory via linear memory import. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say, the host machine has enough RAM for 2 WASM pages. The memory is defined on the guest side and initially requests only one page. When it requests the second page, it would require to allocate 2 more pages, copy data from the old page, and then de-allocate the old page. This effectively requires enough RAM to fit 3 pages.
A nice solution would be to provide to the
Store
an instance ofMemory
(created usingMemory::new_static
) that wasmi will then use instead of the guest-defined memory. Then the host can statically provide as much as possible RAM to the app.Is there already a way to do something similar?
Beta Was this translation helpful? Give feedback.
All reactions