From 762ace9713eb65c6c8c2faaeca69ffafa0b92f2e Mon Sep 17 00:00:00 2001 From: pmovzxdq <19.letters.bears@icloud.com> Date: Sun, 17 Aug 2025 16:37:29 +0200 Subject: [PATCH] std.ArrayListUnamanged fix compile error when @sizeOf(T) == 0 --- lib/std/array_list.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/array_list.zig b/lib/std/array_list.zig index f15e59a42402..b3bad19fb675 100644 --- a/lib/std/array_list.zig +++ b/lib/std/array_list.zig @@ -1403,7 +1403,7 @@ pub fn Aligned(comptime T: type, comptime alignment: ?mem.Alignment) type { return self.getLast(); } - const init_capacity = @as(comptime_int, @max(1, std.atomic.cache_line / @sizeOf(T))); + const init_capacity = if (@sizeOf(T) == 0) math.maxInt(usize) else @as(comptime_int, @max(1, std.atomic.cache_line / @sizeOf(T))); /// Called when memory growth is necessary. Returns a capacity larger than /// minimum that grows super-linearly.