Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Private Function

testDiscard

Private Function
std.compress.zstd.testDiscard
fn testDiscard(gpa: std.mem.Allocator, compressed: []const u8) !usize

Create a Decompress from compressed and immediately discard all output. Returns the number of discarded bytes.

Params

File

compress/zstd.zig:93
93
94
95
96
97
98
99
100
fn testDiscard(gpa: std.mem.Allocator, compressed: []const u8) !usize {
    const buf: []u8 = try gpa.alloc(u8, default_window_len + block_size_max);
    defer gpa.free(buf);

    var in: std.Io.Reader = .fixed(compressed);
    var zstd_stream: Decompress = .init(&in, buf, .{});
    return try zstd_stream.reader.discardRemaining();
}