| ... | ... | @@ -420,7 +420,8 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type { |
| 420 | 420 | self.capacity = 0; |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | | /// Modify the array so that it can hold at least `new_capacity` items. |
| 423 | /// If the current capacity is less than `new_capacity`, this function will |
| 424 | /// modify the array so that it can hold at least `new_capacity` items. |
| 424 | 425 | /// Invalidates pointers if additional memory is needed. |
| 425 | 426 | pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) Allocator.Error!void { |
| 426 | 427 | if (@sizeOf(T) == 0) { |
| ... | ... | @@ -434,9 +435,8 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type { |
| 434 | 435 | return self.ensureTotalCapacityPrecise(better_capacity); |
| 435 | 436 | } |
| 436 | 437 | |
| 437 | | /// Modify the array so that it can hold `new_capacity` items. |
| 438 | | /// Like `ensureTotalCapacity`, but the resulting capacity is guaranteed |
| 439 | | /// to be equal to `new_capacity`. |
| 438 | /// If the current capacity is less than `new_capacity`, this function will |
| 439 | /// modify the array so that it can hold exactly `new_capacity` items. |
| 440 | 440 | /// Invalidates pointers if additional memory is needed. |
| 441 | 441 | pub fn ensureTotalCapacityPrecise(self: *Self, new_capacity: usize) Allocator.Error!void { |
| 442 | 442 | if (@sizeOf(T) == 0) { |
| ... | ... | @@ -985,7 +985,8 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ |
| 985 | 985 | self.capacity = 0; |
| 986 | 986 | } |
| 987 | 987 | |
| 988 | | /// Modify the array so that it can hold at least `new_capacity` items. |
| 988 | /// If the current capacity is less than `new_capacity`, this function will |
| 989 | /// modify the array so that it can hold at least `new_capacity` items. |
| 989 | 990 | /// Invalidates pointers if additional memory is needed. |
| 990 | 991 | pub fn ensureTotalCapacity(self: *Self, allocator: Allocator, new_capacity: usize) Allocator.Error!void { |
| 991 | 992 | if (self.capacity >= new_capacity) return; |
| ... | ... | @@ -994,9 +995,8 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ |
| 994 | 995 | return self.ensureTotalCapacityPrecise(allocator, better_capacity); |
| 995 | 996 | } |
| 996 | 997 | |
| 997 | | /// Modify the array so that it can hold `new_capacity` items. |
| 998 | | /// Like `ensureTotalCapacity`, but the resulting capacity is guaranteed |
| 999 | | /// to be equal to `new_capacity`. |
| 998 | /// If the current capacity is less than `new_capacity`, this function will |
| 999 | /// modify the array so that it can hold exactly `new_capacity` items. |
| 1000 | 1000 | /// Invalidates pointers if additional memory is needed. |
| 1001 | 1001 | pub fn ensureTotalCapacityPrecise(self: *Self, allocator: Allocator, new_capacity: usize) Allocator.Error!void { |
| 1002 | 1002 | if (@sizeOf(T) == 0) { |