pub struct DecodeOpts {
pub threads: Option<usize>,
pub governor: Option<Arc<Governor>>,
pub memory_limit: Option<u64>,
}Fields§
§threads: Option<usize>Worker hint. The governor has final say; this is only a request.
governor: Option<Arc<Governor>>The shared worker/memory budget. None means single-threaded — a codec
parallelises only if handed a governor, never from an ambient global.
memory_limit: Option<u64>Cap on memory a decoder may ask the allocator for. None means
unbounded, which is the library default; the CLI always sets a value.
This exists because three pure codecs size a dictionary buffer from a
value the file declares in its own header, before producing any
output — measured at 69.35 MB peak RSS for a 60-byte .xz, and 538 MB
for a crafted 114-byte .lz that decoded correctly, so the cost came
purely from the declaration. --max-ratio cannot see it: that guard
counts decoded output bytes and the allocation precedes any output.
Exceeding it is crate::Error::ResourceLimit (exit 6), never
Corrupt (exit 5) — the file is not damaged, this build simply will
not allocate that much.
Trait Implementations§
Source§impl Clone for DecodeOpts
impl Clone for DecodeOpts
Source§fn clone(&self) -> DecodeOpts
fn clone(&self) -> DecodeOpts
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more