Skip to main content

estimated_compression_workspace_bytes_for_source

Function estimated_compression_workspace_bytes_for_source 

Source
pub fn estimated_compression_workspace_bytes_for_source(
    level: CompressionLevel,
    src_size_hint: Option<u64>,
) -> usize
Expand description

The same estimate for a source whose size is known.

The window and the match-finder tables are capped by the source, so a level that would reserve hundreds of MiB for an arbitrary stream reserves a fraction of that for a small one — and a caller budgeting memory for a compression it is about to run knows which. None is the arbitrary-stream figure that estimated_compression_workspace_bytes reports.