aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author87 <178735591+87flowers@users.noreply.github.com>2025-06-15 13:29:15 +0100
committerAlex Rønne Petersen <alex@alexrp.com>2025-08-24 23:39:17 +0200
commitbc00932bb2338c895d8cfd35914fccff336aaf39 (patch)
treef2ed97ad35c0c8b70fafaa794d3bb6a5303fc4b7
parent5c0ad01d3c94bce1524333835ffae8831730eca3 (diff)
downloadzig-bc00932bb2338c895d8cfd35914fccff336aaf39.tar.gz
zig-bc00932bb2338c895d8cfd35914fccff336aaf39.zip
lib: Reword documentation for realloc to clarify size
"byte size" is confusing. Clarify we mean number of items.
-rw-r--r--lib/std/mem/Allocator.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/std/mem/Allocator.zig b/lib/std/mem/Allocator.zig
index b81a916702..897f1d2b31 100644
--- a/lib/std/mem/Allocator.zig
+++ b/lib/std/mem/Allocator.zig
@@ -358,8 +358,10 @@ pub fn remap(self: Allocator, allocation: anytype, new_len: usize) t: {
return mem.bytesAsSlice(T, new_memory);
}
-/// This function requests a new byte size for an existing allocation, which
+/// This function requests a new size for an existing allocation, which
/// can be larger, smaller, or the same size as the old memory allocation.
+/// The result is an array of `new_n` items of the same type as the existing
+/// allocation.
///
/// If `new_n` is 0, this is the same as `free` and it always succeeds.
///