Skip to content

wasmtime: Make Store context available to call hooks#8791

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
jameysharp:call-hook-context
Jun 13, 2024
Merged

wasmtime: Make Store context available to call hooks#8791
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
jameysharp:call-hook-context

Conversation

@jameysharp
Copy link
Copy Markdown
Contributor

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.

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 jameysharp requested a review from a team as a code owner June 13, 2024 00:44
@jameysharp jameysharp requested review from elliottt and removed request for a team June 13, 2024 00:44
@jameysharp
Copy link
Copy Markdown
Contributor Author

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.

@github-actions github-actions Bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Jun 13, 2024
@alexcrichton alexcrichton added this pull request to the merge queue Jun 13, 2024
Merged via the queue into bytecodealliance:main with commit c65666c Jun 13, 2024
@jameysharp jameysharp deleted the call-hook-context branch June 13, 2024 17:47
jameysharp added a commit to jameysharp/wasmtime that referenced this pull request Aug 26, 2024
…e#8791)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants