From c814fdbfaf823093497b0d354de559422a3dfda5 Mon Sep 17 00:00:00 2001 From: xackus <14938807+xackus@users.noreply.github.com> Date: Thu, 12 Nov 2020 03:13:19 +0100 Subject: [PATCH] std.mem: improve doc comments --- lib/std/mem.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/std/mem.zig b/lib/std/mem.zig index 532c34e41c..a432a46746 100644 --- a/lib/std/mem.zig +++ b/lib/std/mem.zig @@ -13,7 +13,8 @@ const meta = std.meta; const trait = meta.trait; const testing = std.testing; -/// https://github.com/ziglang/zig/issues/2564 +/// Compile time known minimum page size. +/// https://github.com/ziglang/zig/issues/4082 pub const page_size = switch (builtin.arch) { .wasm32, .wasm64 => 64 * 1024, .aarch64 => switch (builtin.os.tag) { @@ -139,7 +140,7 @@ test "mem.Allocator basics" { /// Copy all of source into dest at position 0. /// dest.len must be >= source.len. -/// dest.ptr must be <= src.ptr. +/// If the slices overlap, dest.ptr must be <= src.ptr. pub fn copy(comptime T: type, dest: []T, source: []const T) void { // TODO instead of manually doing this check for the whole array // and turning off runtime safety, the compiler should detect loops like @@ -152,7 +153,7 @@ pub fn copy(comptime T: type, dest: []T, source: []const T) void { /// Copy all of source into dest at position 0. /// dest.len must be >= source.len. -/// dest.ptr must be >= src.ptr. +/// If the slices overlap, dest.ptr must be >= src.ptr. pub fn copyBackwards(comptime T: type, dest: []T, source: []const T) void { // TODO instead of manually doing this check for the whole array // and turning off runtime safety, the compiler should detect loops like