diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-07-10 12:04:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-10 12:04:27 +0200 |
| commit | 1a998886c863a1829d649f196093f1058cd9cf13 (patch) | |
| tree | db1b3b0a043a113cfb6544e8103cb64f8e4e4d8f /lib/std/io/buffered_reader.zig | |
| parent | 5b4b033236a7bed19c90faf7fefbc1990911cfef (diff) | |
| parent | 10d6db5d7d1fb62ee2915a7ad2c7feb771ea3bbb (diff) | |
| download | zig-1a998886c863a1829d649f196093f1058cd9cf13.tar.gz zig-1a998886c863a1829d649f196093f1058cd9cf13.zip | |
Merge pull request #24329 from ziglang/writergate
Deprecates all existing std.io readers and writers in favor of the newly
provided std.io.Reader and std.io.Writer which are non-generic and have the
buffer above the vtable - in other words the buffer is in the interface, not
the implementation. This means that although Reader and Writer are no longer
generic, they are still transparent to optimization; all of the interface
functions have a concrete hot path operating on the buffer, and only make
vtable calls when the buffer is full.
Diffstat (limited to 'lib/std/io/buffered_reader.zig')
| -rw-r--r-- | lib/std/io/buffered_reader.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/io/buffered_reader.zig b/lib/std/io/buffered_reader.zig index bcf54fb882..548dd92f73 100644 --- a/lib/std/io/buffered_reader.zig +++ b/lib/std/io/buffered_reader.zig @@ -12,7 +12,7 @@ pub fn BufferedReader(comptime buffer_size: usize, comptime ReaderType: type) ty end: usize = 0, pub const Error = ReaderType.Error; - pub const Reader = io.Reader(*Self, Error, read); + pub const Reader = io.GenericReader(*Self, Error, read); const Self = @This(); @@ -61,7 +61,7 @@ test "OneByte" { const Error = error{NoError}; const Self = @This(); - const Reader = io.Reader(*Self, Error, read); + const Reader = io.GenericReader(*Self, Error, read); fn init(str: []const u8) Self { return Self{ @@ -105,7 +105,7 @@ test "Block" { const Error = error{NoError}; const Self = @This(); - const Reader = io.Reader(*Self, Error, read); + const Reader = io.GenericReader(*Self, Error, read); fn init(block: []const u8, reads_allowed: usize) Self { return Self{ |
