Skip to content

Change the injection count of fuel in a store from u32 to u64#3048

Merged
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:more-fueld
Jul 1, 2021
Merged

Change the injection count of fuel in a store from u32 to u64#3048
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:more-fueld

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit updates the type of the amount of times to inject fuel in
the out_of_fuel_async_yield to u64 instead of u32. This should
allow effectively infinite fuel to get injected, even if a small amount
of fuel is injected per iteration.

Closes #2927
Closes #3046

This commit updates the type of the amount of times to inject fuel in
the `out_of_fuel_async_yield` to `u64` instead of `u32`. This should
allow effectively infinite fuel to get injected, even if a small amount
of fuel is injected per iteration.

Closes bytecodealliance#2927
Closes bytecodealliance#3046
Copy link
Copy Markdown
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Lest someone complain that u64 is still not infinite (leading to a "reboot your Boeing plane every 248 days" sort of situation), and that we instead need an out-of-band setting that indicates "forever", I did some quick math: if each injection is 1 tick (worst case) and we are limited to u64::MAX injections, at 4B ticks per second, we have 146 years of runtime. That seems reasonable!

@cfallin
Copy link
Copy Markdown
Member

cfallin commented Jun 30, 2021

... and, reading more of the issue history, I agree that a separate API might make sense for a "truly run forever" situation; it doesn't seem worth API-breakage to change the semantics here.

@github-actions github-actions Bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Jun 30, 2021
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @peterhuene

Details This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton alexcrichton merged commit b9985fe into bytecodealliance:main Jul 1, 2021
@alexcrichton alexcrichton deleted the more-fueld branch July 1, 2021 15:46
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.

Changing out_of_fuel_async_yield's injection_count to a u64 type

2 participants