From ad0f58c3b71edda5670e973977abda01eb167ef8 Mon Sep 17 00:00:00 2001 From: Pranit Date: Wed, 21 Oct 2026 15:45:05 -0400 Subject: [PATCH] Remove the unused failing allocator from the terminal store tests The only test that used it was removed when fx started loading shell startup files once per process, and the allocator stayed behind with no callers. --- src/core/terminal/store.zig | 77 ------------------------------------- 1 file changed, 77 deletions(-) diff --git a/src/core/terminal/store.zig b/src/core/terminal/store.zig index caf0dcd75..75ed91709 100644 --- a/src/core/terminal/store.zig +++ b/src/core/terminal/store.zig @@ -6119,83 +6119,6 @@ const TestStoreFixture = struct { } }; -const OneShotFailingAllocator = struct { - failing: std.testing.FailingAllocator, - - fn init(alloc: Allocator) OneShotFailingAllocator { - return .{ .failing = .init(alloc, .{}) }; - } - - fn allocator(self: *OneShotFailingAllocator) Allocator { - return .{ .ptr = self, .vtable = &.{ - .alloc = allocate, - .resize = resize, - .remap = remap, - .free = free, - } }; - } - - fn allocate( - raw: *anyopaque, - len: usize, - alignment: std.mem.Alignment, - return_address: usize, - ) ?[*]u8 { - const self: *OneShotFailingAllocator = @ptrCast(@alignCast(raw)); - const result = self.failing.allocator().rawAlloc( - len, - alignment, - return_address, - ); - if (result == null and self.failing.has_induced_failure) { - self.failing.fail_index = std.math.maxInt(usize); - } - return result; - } - - fn resize( - raw: *anyopaque, - memory: []u8, - alignment: std.mem.Alignment, - new_len: usize, - return_address: usize, - ) bool { - const self: *OneShotFailingAllocator = @ptrCast(@alignCast(raw)); - return self.failing.allocator().rawResize( - memory, - alignment, - new_len, - return_address, - ); - } - - fn remap( - raw: *anyopaque, - memory: []u8, - alignment: std.mem.Alignment, - new_len: usize, - return_address: usize, - ) ?[*]u8 { - const self: *OneShotFailingAllocator = @ptrCast(@alignCast(raw)); - return self.failing.allocator().rawRemap( - memory, - alignment, - new_len, - return_address, - ); - } - - fn free( - raw: *anyopaque, - memory: []u8, - alignment: std.mem.Alignment, - return_address: usize, - ) void { - const self: *OneShotFailingAllocator = @ptrCast(@alignCast(raw)); - self.failing.allocator().rawFree(memory, alignment, return_address); - } -}; - const ConcurrentAppend = struct { session: *DurableSession, result: ?anyerror = null,