Stream: git-wasmtime

Topic: wasmtime / PR #4152 Run a callback when the interruption ...


view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 19:49):

SquidDev opened PR #4152 from feature/trap-hook to main:

Adds Store::epoch_deadline_callback. This accepts a callback which, when invoked, can mutate the store's contents. The callback can either return an error (in which case we trap) or return a delta which we'll use to set the new epoch deadline.

As discussed with @alexcrichton on Zulip. I'm not very happy with the tests here - happy to improve those if people have ideas.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 19:50):

SquidDev edited PR #4152 from feature/trap-hook to main:

Adds Store::epoch_deadline_callback. This accepts a callback which, when invoked, can mutate the store's contents. The callback can either return an error (in which case we trap) or return a delta which we'll use to set the new epoch deadline.

As discussed with @alexcrichton on Zulip. I'm not very happy with the tests here - happy to improve those if people have ideas.

It might be desirable to reimplement the trap and yield behaviours in terms of this callback. Happy to do that if preferred.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 21:18):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 21:18):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 21:18):

alexcrichton created PR review comment:

As a small nit, this can probably use ? to remove the error handling perhaps

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 21:18):

alexcrichton created PR review comment:

As a small nit the leading &mut here can be removed

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2022 at 21:18):

alexcrichton created PR review comment:

For symmetry with above this &mut can also be removed although you'll need to do let delta = *delta below I think

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2022 at 20:18):

SquidDev updated PR #4152 from feature/trap-hook to main.

view this post on Zulip Wasmtime GitHub notifications bot (May 16 2022 at 12:28):

alexcrichton merged PR #4152.


Last updated: Dec 23 2024 at 12:05 UTC