authorgravatar for 178735591+87flowers@users.noreply.github.com87 <178735591+87flowers@users.noreply.github.com> 2025-06-15 13:29:15+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-08-25 18:51:26+02:00
logd4e5d1e15c1c8ff85f611e82cb9fd7f7084a7b38
tree4de52b96d84ceff9395d490ff87813b6d0cbfe91
parent17928ef58b1ab110c1f944b5991540d4a938b057
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

lib: Reword documentation for realloc to clarify size

"byte size" is confusing. Clarify we mean number of items.

1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/mem/Allocator.zig+3-1
...@@ -358,8 +358,10 @@ pub fn remap(self: Allocator, allocation: anytype, new_len: usize) t: {...@@ -358,8 +358,10 @@ pub fn remap(self: Allocator, allocation: anytype, new_len: usize) t: {
358 return mem.bytesAsSlice(T, new_memory);358 return mem.bytesAsSlice(T, new_memory);
359}359}
360360
361/// This function requests a new byte size for an existing allocation, which361/// This function requests a new size for an existing allocation, which
362/// can be larger, smaller, or the same size as the old memory allocation.362/// can be larger, smaller, or the same size as the old memory allocation.
363/// The result is an array of `new_n` items of the same type as the existing
364/// allocation.
363///365///
364/// If `new_n` is 0, this is the same as `free` and it always succeeds.366/// If `new_n` is 0, this is the same as `free` and it always succeeds.
365///367///