Files
ghostty/src/lib/main.zig
Mitchell Hashimoto 82df79ec8d libghostty: replace Io.Threaded with custom Io impl (TinyIo)
Add a new Io implementation `TinyIo` that only supports the operations
we need and doesn't support concurrency. This shrinks the binary size
of libghostty by anywhere from ~100KB (macOS) to ~200KB (Linux) and 
runtime memory requirements by over 256KB (the thread-local storage
`std.Io.Threaded` creates plus the 18KB threaded structure is gone).

`TinyIo` is POSIX-only: Windows keeps std.Io.Threaded, and on
freestanding targets (wasm) TinyIo degrades to std.Io.failing
behavior just like before.  

It is also exported from the Zig module as `ghostty.TinyIo` so
Zig embedders can opt into the same size win when constructing
terminals.
2026-08-09 13:55:56 -07:00

21 lines
665 B
Zig

const std = @import("std");
const enumpkg = @import("enum.zig");
const structpkg = @import("struct.zig");
const types = @import("types.zig");
const unionpkg = @import("union.zig");
pub const allocator = @import("allocator.zig");
pub const TinyIo = @import("TinyIo.zig");
pub const Buffer = types.Buffer;
pub const Enum = enumpkg.Enum;
pub const checkGhosttyHEnum = enumpkg.checkGhosttyHEnum;
pub const String = types.String;
pub const Struct = structpkg.Struct;
pub const structSizedFieldFits = structpkg.sizedFieldFits;
pub const Target = @import("target.zig").Target;
pub const TaggedUnion = unionpkg.TaggedUnion;
test {
std.testing.refAllDecls(@This());
}