authorgravatar for 22063072+delitako@users.noreply.github.comdelitako <22063072+delitako@users.noreply.github.com> 2022-11-05 16:55:50-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-09 13:49:43-07:00
log3608b1d036e6b16cbea3dac59961b203e3532901
treecf52cc8ff6d31d7d1037fd6a0484ad02a788e325
parentfaca0e4220d1cf6910f6ea7f7ea03077438c5a4d

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 {
746746 }
747747
748748 /// 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 safe
749 /// *WARNING* using this at the same time as the interface returned by `allocator` is not thread safe
750750 pub fn threadSafeAllocator(self: *FixedBufferAllocator) Allocator {
751751 return Allocator.init(
752752 self,
lib/std/mem.zig+1
......@@ -2891,6 +2891,7 @@ test "rotate" {
28912891/// Replace needle with replacement as many times as possible, writing to an output buffer which is assumed to be of
28922892/// appropriate size. Use replacementSize to calculate an appropriate buffer size.
28932893/// The needle must not be empty.
2894/// Returns the number of replacements made.
28942895pub fn replace(comptime T: type, input: []const T, needle: []const T, replacement: []const T, output: []T) usize {
28952896 // Empty needle will loop until output buffer overflows.
28962897 assert(needle.len > 0);