authorgravatar for 22063072+delitako@users.noreply.github.comdelitako <22063072+delitako@users.noreply.github.com> 2022-11-05 16:55:50-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-11-05 22:55:50+01:00
logc8a5ad6d9db529f3440bfd53b1bda8ded6a50a7c
tree71857fe074b0b91c58cb6677a77c5169012e77c6
parentaea617c60be848ed372343e08465bb0ac6cb7b85
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Improve doc comments for two functions (#13456)

* std.heap: fix function name in doc comment * std.mem: document return value of `replace`

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

lib/std/heap.zig+1-1
...@@ -746,7 +746,7 @@ pub const FixedBufferAllocator = struct {...@@ -746,7 +746,7 @@ pub const FixedBufferAllocator = struct {
746 }746 }
747747
748 /// Provides a lock free thread safe `Allocator` interface to the underlying `FixedBufferAllocator`748 /// Provides a lock free thread safe `Allocator` interface to the underlying `FixedBufferAllocator`
749 /// *WARNING* using this at the same time as the interface returned by `getAllocator` is not thread safe749 /// *WARNING* using this at the same time as the interface returned by `allocator` is not thread safe
750 pub fn threadSafeAllocator(self: *FixedBufferAllocator) Allocator {750 pub fn threadSafeAllocator(self: *FixedBufferAllocator) Allocator {
751 return Allocator.init(751 return Allocator.init(
752 self,752 self,
lib/std/mem.zig+1
...@@ -2891,6 +2891,7 @@ test "rotate" {...@@ -2891,6 +2891,7 @@ test "rotate" {
2891/// Replace needle with replacement as many times as possible, writing to an output buffer which is assumed to be of2891/// Replace needle with replacement as many times as possible, writing to an output buffer which is assumed to be of
2892/// appropriate size. Use replacementSize to calculate an appropriate buffer size.2892/// appropriate size. Use replacementSize to calculate an appropriate buffer size.
2893/// The needle must not be empty.2893/// The needle must not be empty.
2894/// Returns the number of replacements made.
2894pub fn replace(comptime T: type, input: []const T, needle: []const T, replacement: []const T, output: []T) usize {2895pub fn replace(comptime T: type, input: []const T, needle: []const T, replacement: []const T, output: []T) usize {
2895 // Empty needle will loop until output buffer overflows.2896 // Empty needle will loop until output buffer overflows.
2896 assert(needle.len > 0);2897 assert(needle.len > 0);