pub struct Limits {
pub time_limit_ms: Option<u64>,
pub mem_limit_mb: u64,
}Expand description
The limits a run works under: the time it may take and the address space it may use.
These are the binary’s --time-limit-ms and --mem-limit-mb, with the
same meaning. Limits::default() sets neither.
let limits = tididi_cnf::Limits { time_limit_ms: Some(60_000), ..Default::default() };
assert_eq!(limits.mem_limit_mb, 0);Fields§
§time_limit_ms: Option<u64>The time the whole run may take, in milliseconds, counted from the
moment it starts. Every stage budget is a share of it, and a run that
reaches it stops with Error::Incomplete.
None sets no limit, and the stages use fixed budgets of their own.
mem_limit_mb: u64Lower the process’s address-space limit (RLIMIT_AS) to this many MiB
while the run lasts, as ulimit -v does, so the stages that adapt to
memory pressure can see the limit: a compile that runs out of memory
splits the formula instead of failing. The run only ever lowers the
limit, never raises it, and puts back the one it found when it
returns. 0 leaves it unchanged, the library’s default. The binary’s
--mem-limit-mb has a default of its own, which tididi --help
prints. A WebAssembly build has no such limit and refuses any other
value with Error::Usage.