mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-04 06:38:37 +00:00
global: take minimal instead of juicy main
The early-stage main Zig wrapper recognizes if main only needs the minimal state (args and lower-level environment) and skips a bunch of unneeded initialization (allocator, arena, threaded I/O, and the higher-level environment map). Particularly, the fact that it does not set up an I/O instance means that we won't have any unneeded signal handlers set up for the unused threaded I/O implementation, which is similar in spirit to the fixes we applied for the C VT implementation, with the notable difference that we do actually set a threaded I/O up in global state - hence, again, we don't want the duplicate unused one.
This commit is contained in:
@@ -45,12 +45,12 @@ pub const Action = enum {
|
||||
};
|
||||
|
||||
/// An entrypoint for the benchmark CLI.
|
||||
pub fn main(init: std.process.Init) !void {
|
||||
try global.init(.{ .tool = init });
|
||||
pub fn main(minimal: std.process.Init.Minimal) !void {
|
||||
try global.init(.{ .tool = minimal });
|
||||
const alloc = std.heap.c_allocator;
|
||||
const action_ = try cli.action.detectArgs(Action, alloc, init.minimal.args);
|
||||
const action_ = try cli.action.detectArgs(Action, alloc, minimal.args);
|
||||
const action = action_ orelse return error.NoAction;
|
||||
try mainAction(alloc, action, .{ .cli = init.minimal.args });
|
||||
try mainAction(alloc, action, .{ .cli = minimal.args });
|
||||
}
|
||||
|
||||
/// Arguments that can be passed to the benchmark.
|
||||
|
||||
Reference in New Issue
Block a user