| author | |
| committer | |
| log | c8a5ad6d9db529f3440bfd53b1bda8ded6a50a7c |
| tree | 71857fe074b0b91c58cb6677a77c5169012e77c6 |
| parent | aea617c60be848ed372343e08465bb0ac6cb7b85 |
| signature |
* 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 | } |
| 747 | 747 | ||
| 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 safe | 749 | /// *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 of | 2891 | /// 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. | ||
| 2894 | pub fn replace(comptime T: type, input: []const T, needle: []const T, replacement: []const T, output: []T) usize { | 2895 | pub 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); |