Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

fuzzedHuffmanDrainSpaceLimit

Compress.fuzzedHuffmanDrainSpaceLimit
fn fuzzedHuffmanDrainSpaceLimit(max_drain: usize, written: usize, eos: bool) usize

File

lib/std/compress/flate/Compress.zig:2500

Code

fn fuzzedHuffmanDrainSpaceLimit(max_drain: usize, written: usize, eos: bool) usize {
    var block_lim = math.divCeil(usize, max_drain, Huffman.max_tokens) catch unreachable;
    block_lim = @max(block_lim, @intFromBool(eos));
    const footer_overhead = @as(u8, 8) * @intFromBool(eos);
    // 6 for a raw block header (the block header may span two bytes)
    return written + 6 * block_lim + max_drain + footer_overhead;
}