From 8bd1c33fec08f27bfde02121b3a06d470a2eefe5 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Mar 2021 07:03:08 -0800 Subject: [PATCH] Add a comment documenting fuel consumption rates. (#2711) --- crates/wasmtime/src/store.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/wasmtime/src/store.rs b/crates/wasmtime/src/store.rs index 7945270a35..1b771417be 100644 --- a/crates/wasmtime/src/store.rs +++ b/crates/wasmtime/src/store.rs @@ -574,6 +574,11 @@ impl Store { /// immediately trap). This function must be called for the store to have /// some fuel to allow WebAssembly to execute. /// + /// Most WebAssembly instructions consume 1 unit of fuel. Some + /// instructions, such as `nop`, `drop`, `block`, and `loop`, consume 0 + /// units, as any execution cost associated with them involves other + /// instructions which do consume fuel. + /// /// Note that at this time when fuel is entirely consumed it will cause /// wasm to trap. More usages of fuel are planned for the future. ///