Function miniz_oxide::inflate::core::decompress_fast

source ·
fn decompress_fast(
    r: &mut DecompressorOxide,
    in_iter: &mut InputWrapper<'_>,
    out_buf: &mut OutputBuffer<'_>,
    flags: u32,
    local_vars: &mut LocalVars,
    out_buf_size_mask: usize,
) -> (TINFLStatus, State)
Expand description

Fast inner decompression loop which is run while there is at least 259 bytes left in the output buffer, and at least 6 bytes left in the input buffer (The maximum one match would need + 1).

This was inspired by a similar optimization in zlib, which uses this info to do faster unchecked copies of multiple bytes at a time. Currently we don’t do this here, but this function does avoid having to jump through the big match loop on each state change(as rust does not have fallthrough or gotos at the moment), and already improves decompression speed a fair bit.