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

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

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

* Fix tokio example
This commit is contained in:
Alex Crichton
2021-07-01 10:46:21 -05:00
committed by GitHub
parent 7453bd5f0d
commit b9985fe2e5
4 changed files with 8 additions and 8 deletions

View File

@@ -392,7 +392,7 @@ fn iloop_with_fuel() {
fn fuel_eventually_finishes() {
let engine = Engine::new(Config::new().async_support(true).consume_fuel(true)).unwrap();
let mut store = Store::new(&engine, ());
store.out_of_fuel_async_yield(u32::max_value(), 10);
store.out_of_fuel_async_yield(u64::max_value(), 10);
let module = Module::new(
&engine,
"