From a027fa8b8c03f8c325c4347500d0487c6d366f81 Mon Sep 17 00:00:00 2001 From: Justus Klausecker Date: Wed, 22 Oct 2025 01:03:43 +0200 Subject: [PATCH] std.mem.Allocator: fix resize doc comment --- lib/std/mem/Allocator.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/mem/Allocator.zig b/lib/std/mem/Allocator.zig index 1d1653d3a0..72581236e6 100644 --- a/lib/std/mem/Allocator.zig +++ b/lib/std/mem/Allocator.zig @@ -303,7 +303,8 @@ fn allocBytesWithAlignment( /// It is guaranteed to not move the pointer, however the allocator /// implementation may refuse the resize request by returning `false`. /// -/// `allocation` may be an empty slice, in which case a new allocation is made. +/// `allocation` may be an empty slice, in which case `false` is returned, +/// unless `new_len` is also 0, in which case `true` is returned. /// /// `new_len` may be zero, in which case the allocation is freed. pub fn resize(self: Allocator, allocation: anytype, new_len: usize) bool {