mongo/bazel/wasmtime/store_rs.patch
Lee Maguire da7af1bad1 SERVER-116055 Add support for $accumulator in MozJS WASM engine. (#53341)
GitOrigin-RevId: 575a1be1e9bf6e8510aab16cdd924428473e7ca2
2026-05-13 15:25:20 +00:00

21 lines
605 B
Diff

--- a/src/store.rs
+++ b/src/store.rs
@@ -263,6 +263,17 @@
crate::handle_result(store.set_fuel(fuel), |()| {})
}
+/// Sets the per-Store hostcall fuel cap that bounds how much data wasmtime
+/// will copy between the host and the guest across component-model calls.
+/// Pass `usize::MAX` for "unlimited".
+#[unsafe(no_mangle)]
+pub extern "C" fn wasmtime_context_set_hostcall_fuel(
+ mut store: WasmtimeStoreContextMut<'_>,
+ fuel: usize,
+) {
+ store.set_hostcall_fuel(fuel);
+}
+
#[unsafe(no_mangle)]
pub extern "C" fn wasmtime_context_get_fuel(
store: WasmtimeStoreContext<'_>,