authorgravatar for evyatar.shafran@gmail.comEJ <evyatar.shafran@gmail.com> 2026-07-22 20:31:11+02:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-07-22 20:31:11+02:00
log5da11070e9851d15b7c6200006ae525a22ef8c18
tree19d12e1095d01c0e1ad53c186bf294061fd4c35a
parentcad234174ae7ae990ebc526b6fcd92d18516e3c1

Test that Allocator interface avoids IB for max size allocations (#35437)

Closes [#6076](https://github.com/ziglang/zig/issues/6076) Tracking issue: #31661 Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35437

1 files changed, 3 insertions(+), 0 deletions(-)

lib/std/mem/Allocator.zig+3
......@@ -587,4 +587,7 @@ fn unreachableFree(
587587test failing {
588588 const f: Allocator = .failing;
589589 try std.testing.expectError(error.OutOfMemory, f.alloc(u8, 123));
590 // Expect very large allocations to fail at the implementation level and not in the interface
591 try std.testing.expectError(error.OutOfMemory, f.alloc(u8, std.math.maxInt(usize)));
592 try std.testing.expectError(error.OutOfMemory, f.allocSentinel(u8, std.math.maxInt(usize) - 1, 0));
590593}