From 0073d05329335dbb0eb85f5c3044e42805d144e5 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 23 Oct 2026 17:10:58 -0300 Subject: Callstack lists every caller and pages a tree too big for one query; memory bounds and resident-size fixes Callstack walks while the server answers, counts on the message row past a second, puts test callers last at each level, and ends a tree past one query's memory (memory.limits.arena.lsp_query, a 256 MiB region taken and given back per query) in a row whose Callstack shows the next page. Grep reads whole files. New hard limits: undo text per file, image decode pixels, the LSP snapshot of other open files, one paste. Safe builds no longer fill worst-case buffers with 0xAA (memory.unfilled), big regions are kept off transparent huge pages, and malloc_trim runs after big results. Also: Look's git show pages into a +Diff, and dropped marks in File. Co-Authored-By: Claude Opus 5.5 --- src/mini.zig | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/mini.zig') diff --git a/src/mini.zig b/src/mini.zig index ce291c99..8d8ea0b2 100644 --- a/src/mini.zig +++ b/src/mini.zig @@ -313,7 +313,21 @@ test "Mini publishes only complete snapshots and content replacement drops metad const dir = dir_buf[0..try tmp.dir.realPath(std.testing.io, &dir_buf)]; var path_buf: [4096]u8 = undefined; const path = try std.fmt.bufPrint(&path_buf, "{s}/mini.txt", .{dir}); - try std.testing.checkAllAllocationFailures(std.testing.allocator, Case.run, .{path}); + // Growth that never resizes in place: whether a resize fits where it is + // depends on the heap's layout, and with it how many allocations a run + // makes, which checkAllAllocationFailures needs to be the same each run. + const NoResize = struct { + fn resize(_: *anyopaque, _: []u8, _: std.mem.Alignment, _: usize, _: usize) bool { + return false; + } + fn remap(_: *anyopaque, _: []u8, _: std.mem.Alignment, _: usize, _: usize) ?[*]u8 { + return null; + } + }; + const testing_vtable = std.testing.allocator.vtable; + const no_resize_vtable: std.mem.Allocator.VTable = .{ .alloc = testing_vtable.alloc, .resize = NoResize.resize, .remap = NoResize.remap, .free = testing_vtable.free }; + const backing: std.mem.Allocator = .{ .ptr = std.testing.allocator.ptr, .vtable = &no_resize_vtable }; + try std.testing.checkAllAllocationFailures(backing, Case.run, .{path}); } test "Mini refuses a file that is no UTF-8, before its decoding could panic" { -- cgit v1.3