bytecodealliance / wasmtime

A fast and secure runtime for WebAssembly
https://wasmtime.dev/
Apache License 2.0
14.82k stars 1.24k forks source link

wasmtime: Make Store context available to call hooks #8791

Closed jameysharp closed 3 weeks ago

jameysharp commented 3 weeks ago

Rather than digging only the embedder's store-specific data out and passing that along, pass access to the entire Store. This is the same thing we do for epoch interruption hooks, including the annoyance of having to take the callback out of the store temporarily while calling it to avoid having multiple mutable borrows.

jameysharp commented 3 weeks ago

I think the only other example of this pattern in Store is Store::limiter and its async variant. I don't want to change that today but I think it's worth discussing whether we should do that eventually.