From afd1818de78e34b6a16a38bed09706d9a5bf78ad Mon Sep 17 00:00:00 2001 From: Fredrik Kihlander Date: Sun, 16 Aug 2026 10:13:05 +0200 Subject: [PATCH] pass 'self' by pointer instead of by value in ensureUnusedCapacity(). Not doing this can cause exhaustive copying of memory leading to horrible performance. --- src/bounded_array.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bounded_array.zig b/src/bounded_array.zig index 426145b..7f6030d 100644 --- a/src/bounded_array.zig +++ b/src/bounded_array.zig @@ -99,7 +99,7 @@ pub fn BoundedArrayAligned( } /// Check that the slice can hold at least `additional_count` items. - pub fn ensureUnusedCapacity(self: Self, additional_count: usize) error{Overflow}!void { + pub fn ensureUnusedCapacity(self: *Self, additional_count: usize) error{Overflow}!void { if (self.len + additional_count > buffer_capacity) { return error.Overflow; }