From 235eebfa9295ef2877321656b35f160d8a3d0b5c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 10 Jan 2026 06:55:21 -0800 Subject: [PATCH] terminal: during test, use the testing allocator for pages --- src/terminal/PageList.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/terminal/PageList.zig b/src/terminal/PageList.zig index cd4064445..2acdfc9c3 100644 --- a/src/terminal/PageList.zig +++ b/src/terminal/PageList.zig @@ -259,6 +259,9 @@ fn minMaxSize(cols: size.CellCountInt, rows: size.CellCountInt) !usize { /// This is the page allocator we'll use for all our underlying /// VM page allocations. inline fn pageAllocator() Allocator { + // In tests we use our testing allocator so we can detect leaks. + if (builtin.is_test) return std.testing.allocator; + // On non-macOS we use our standard Zig page allocator. if (!builtin.target.os.tag.isDarwin()) return std.heap.page_allocator;