terminal: during test, use the testing allocator for pages

This commit is contained in:
Mitchell Hashimoto
2026-01-10 06:55:21 -08:00
parent 9ee78d82c0
commit 235eebfa92

View File

@@ -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;