1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! `wasmtime::Engine` factory + sandbox knobs.
//!
//! We build the engine once per runtime instance (engines are cheap to
//! share — modules are the heavy thing) and clone it into every store.
//! The configuration is the **single source of truth** for what
//! "sandboxed" means in outl:
//!
//! - Fuel on (consume_fuel = true) → caller decides how many
//! instructions a run gets.
//! - Epoch interruption on → caller bumps the engine's epoch from a
//! timer thread for wall-clock cancellation. Today
//! [`crate::sandbox::with_timeout`] still does the thread-based
//! timeout; the epoch path is wired up so an upcoming refactor can
//! move to it without a config churn.
use ;
/// Sandbox limits a single `execute` call may use.
///
/// The defaults are conservative: 1 million instructions, 64 MiB heap,
/// no growth beyond that. Callers tighten as needed (a tiny snippet
/// running in a TUI loop deserves much less than a long batch job).
/// Build a `wasmtime::Engine` with the outl sandbox configuration.
/// Cheap to call; reuse the result across `WasmModule` instances when
/// possible.