Skip to content

Commit a027fa8

Browse files
Justus2308mlugg
authored andcommitted
std.mem.Allocator: fix resize doc comment
1 parent 8d4b566 commit a027fa8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/std/mem/Allocator.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ fn allocBytesWithAlignment(
303303
/// It is guaranteed to not move the pointer, however the allocator
304304
/// implementation may refuse the resize request by returning `false`.
305305
///
306-
/// `allocation` may be an empty slice, in which case a new allocation is made.
306+
/// `allocation` may be an empty slice, in which case `false` is returned,
307+
/// unless `new_len` is also 0, in which case `true` is returned.
307308
///
308309
/// `new_len` may be zero, in which case the allocation is freed.
309310
pub fn resize(self: Allocator, allocation: anytype, new_len: usize) bool {

0 commit comments

Comments
 (0)