mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-20 20:48:06 +00:00
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.
21 lines
665 B
Zig
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());
|
|
}
|