mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-20 20:48:06 +00:00
Limit individual allocator requests made by PNG decoders to the Kitty graphics protocol's 400 MiB image ceiling. Add a reusable allocator wrapper for callers that need per-request bounds. PNG decoding previously used Wuffs' 4 GiB package limit and checked the result only after allocation. A tiny PNG with oversized dimensions could cause a multi-gigabyte RSS spike before being rejected. Wrap decoder allocators with LimitedAllocator and translate limit rejections to invalid image data while preserving genuine out-of-memory errors. Add allocator boundary tests and regression coverage for a crafted PNG below Wuffs' limit.
25 lines
977 B
Zig
25 lines
977 B
Zig
//! The datastruct package contains data structures or anything closely
|
|
//! related to data structures.
|
|
|
|
const blocking_queue = @import("blocking_queue.zig");
|
|
const cache_table = @import("cache_table.zig");
|
|
const circ_buf = @import("circ_buf.zig");
|
|
const intrusive_linked_list = @import("intrusive_linked_list.zig");
|
|
const segmented_pool = @import("segmented_pool.zig");
|
|
const split_tree = @import("split_tree.zig");
|
|
|
|
pub const BlockingQueue = blocking_queue.BlockingQueue;
|
|
pub const CacheTable = cache_table.CacheTable;
|
|
pub const CircBuf = circ_buf.CircBuf;
|
|
pub const IntrusiveDoublyLinkedList = intrusive_linked_list.DoublyLinkedList;
|
|
pub const LimitedAllocator = @import("limited_allocator.zig").LimitedAllocator;
|
|
pub const MessageData = @import("message_data.zig").MessageData;
|
|
pub const SegmentedPool = segmented_pool.SegmentedPool;
|
|
pub const SplitTree = split_tree.SplitTree;
|
|
|
|
test {
|
|
@import("std").testing.refAllDecls(@This());
|
|
|
|
_ = @import("comparison.zig");
|
|
}
|