diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-10-01 13:10:40 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-10-03 07:10:43 -0700 |
| commit | cb295b84a0ec274a43da59041fa4a199e799798d (patch) | |
| tree | ac7d5a77a12ecf021983e20d7602226668d8aadb /src/benchmark/TerminalStream.zig | |
| parent | 3770f97608409d450a1ab0364974ee7fb1c50f13 (diff) | |
Zig 0.15: zig build test
Diffstat (limited to 'src/benchmark/TerminalStream.zig')
| -rw-r--r-- | src/benchmark/TerminalStream.zig | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/benchmark/TerminalStream.zig b/src/benchmark/TerminalStream.zig index 71ab1fdfc..ecce509f3 100644 --- a/src/benchmark/TerminalStream.zig +++ b/src/benchmark/TerminalStream.zig @@ -113,17 +113,19 @@ fn step(ptr: *anyopaque) Benchmark.Error!void { // the benchmark results and... I know writing this that we // aren't currently IO bound. const f = self.data_f orelse return; - var r = std.io.bufferedReader(f.reader()); - var buf: [4096]u8 align(std.atomic.cache_line) = undefined; + var read_buf: [4096]u8 = undefined; + var f_reader = f.reader(&read_buf); + const r = &f_reader.interface; + + var buf: [4096]u8 = undefined; while (true) { - const n = r.read(&buf) catch |err| { - log.warn("error reading data file err={}", .{err}); + const n = r.readSliceShort(&buf) catch { + log.warn("error reading data file err={?}", .{f_reader.err}); return error.BenchmarkFailed; }; if (n == 0) break; // EOF reached - const chunk = buf[0..n]; - self.stream.nextSlice(chunk) catch |err| { + self.stream.nextSlice(buf[0..n]) catch |err| { log.warn("error processing data file chunk err={}", .{err}); return error.BenchmarkFailed; }; |
