mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-29 16:25:20 +00:00
doNotOptimizeAway
This commit is contained in:
@@ -21,7 +21,7 @@ data_f: ?std.fs.File = null,
|
||||
|
||||
pub const Options = struct {
|
||||
/// Which test to run.
|
||||
mode: Mode = .ziglyph,
|
||||
mode: Mode = .uucode,
|
||||
|
||||
/// The data to read as a filepath. If this is "-" then
|
||||
/// we will read stdin. If this is unset, then we will
|
||||
@@ -32,8 +32,8 @@ pub const Options = struct {
|
||||
};
|
||||
|
||||
pub const Mode = enum {
|
||||
/// "Naive" ziglyph implementation.
|
||||
ziglyph,
|
||||
/// uucode implementation
|
||||
uucode,
|
||||
|
||||
/// Ghostty's table-based approach.
|
||||
table,
|
||||
@@ -57,7 +57,7 @@ pub fn destroy(self: *IsSymbol, alloc: Allocator) void {
|
||||
pub fn benchmark(self: *IsSymbol) Benchmark {
|
||||
return .init(self, .{
|
||||
.stepFn = switch (self.opts.mode) {
|
||||
.ziglyph => stepZiglyph,
|
||||
.uucode => stepUucode,
|
||||
.table => stepTable,
|
||||
},
|
||||
.setupFn = setup,
|
||||
@@ -85,7 +85,7 @@ fn teardown(ptr: *anyopaque) void {
|
||||
}
|
||||
}
|
||||
|
||||
fn stepZiglyph(ptr: *anyopaque) Benchmark.Error!void {
|
||||
fn stepUucode(ptr: *anyopaque) Benchmark.Error!void {
|
||||
const self: *IsSymbol = @ptrCast(@alignCast(ptr));
|
||||
|
||||
const f = self.data_f orelse return;
|
||||
|
||||
Reference in New Issue
Block a user