aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/benchmark/CodepointWidth.zig
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/libghostty-vt/src/benchmark/CodepointWidth.zig')
-rw-r--r--vendor/libghostty-vt/src/benchmark/CodepointWidth.zig11
1 files changed, 6 insertions, 5 deletions
diff --git a/vendor/libghostty-vt/src/benchmark/CodepointWidth.zig b/vendor/libghostty-vt/src/benchmark/CodepointWidth.zig
index 30d3f91e..d0c6b808 100644
--- a/vendor/libghostty-vt/src/benchmark/CodepointWidth.zig
+++ b/vendor/libghostty-vt/src/benchmark/CodepointWidth.zig
@@ -14,13 +14,14 @@ const options = @import("options.zig");
const UTF8Decoder = @import("../terminal/UTF8Decoder.zig");
const simd = @import("../simd/main.zig");
const table = @import("../unicode/main.zig").table;
+const global = @import("../global.zig");
const log = std.log.scoped(.@"terminal-stream-bench");
opts: Options,
/// The file, opened in the setup function.
-data_f: ?std.fs.File = null,
+data_f: ?std.Io.File = null,
pub const Options = struct {
/// The type of codepoint width calculation to use.
@@ -93,7 +94,7 @@ fn setup(ptr: *anyopaque) Benchmark.Error!void {
fn teardown(ptr: *anyopaque) void {
const self: *CodepointWidth = @ptrCast(@alignCast(ptr));
if (self.data_f) |f| {
- f.close();
+ f.close(global.io());
self.data_f = null;
}
}
@@ -114,7 +115,7 @@ fn stepWcwidth(ptr: *anyopaque) Benchmark.Error!void {
const f = self.data_f orelse return;
var read_buf: [4096]u8 align(std.atomic.cache_line) = undefined;
- var f_reader = f.reader(&read_buf);
+ var f_reader = f.reader(global.io(), &read_buf);
var r = &f_reader.interface;
var d: UTF8Decoder = .{};
@@ -141,7 +142,7 @@ fn stepTable(ptr: *anyopaque) Benchmark.Error!void {
const f = self.data_f orelse return;
var read_buf: [4096]u8 align(std.atomic.cache_line) = undefined;
- var f_reader = f.reader(&read_buf);
+ var f_reader = f.reader(global.io(), &read_buf);
var r = &f_reader.interface;
var d: UTF8Decoder = .{};
@@ -173,7 +174,7 @@ fn stepSimd(ptr: *anyopaque) Benchmark.Error!void {
const f = self.data_f orelse return;
var read_buf: [4096]u8 align(std.atomic.cache_line) = undefined;
- var f_reader = f.reader(&read_buf);
+ var f_reader = f.reader(global.io(), &read_buf);
var r = &f_reader.interface;
var d: UTF8Decoder = .{};