authorgravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2020-11-12 03:13:19+01:00
committergravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2020-11-14 13:59:29+01:00
logc814fdbfaf823093497b0d354de559422a3dfda5
treedbc04c2d845b7c1d8775b81585d73f98487124e1
parentbf03ae7acc2e8478958e46b2e418fcf29aa99128

std.mem: improve doc comments


1 files changed, 4 insertions(+), 3 deletions(-)

lib/std/mem.zig+4-3
...@@ -13,7 +13,8 @@ const meta = std.meta;...@@ -13,7 +13,8 @@ const meta = std.meta;
13const trait = meta.trait;13const trait = meta.trait;
14const testing = std.testing;14const testing = std.testing;
1515
16/// https://github.com/ziglang/zig/issues/256416/// Compile time known minimum page size.
17/// https://github.com/ziglang/zig/issues/4082
17pub const page_size = switch (builtin.arch) {18pub const page_size = switch (builtin.arch) {
18 .wasm32, .wasm64 => 64 * 1024,19 .wasm32, .wasm64 => 64 * 1024,
19 .aarch64 => switch (builtin.os.tag) {20 .aarch64 => switch (builtin.os.tag) {
...@@ -139,7 +140,7 @@ test "mem.Allocator basics" {...@@ -139,7 +140,7 @@ test "mem.Allocator basics" {
139140
140/// Copy all of source into dest at position 0.141/// Copy all of source into dest at position 0.
141/// dest.len must be >= source.len.142/// dest.len must be >= source.len.
142/// dest.ptr must be <= src.ptr.143/// If the slices overlap, dest.ptr must be <= src.ptr.
143pub fn copy(comptime T: type, dest: []T, source: []const T) void {144pub fn copy(comptime T: type, dest: []T, source: []const T) void {
144 // TODO instead of manually doing this check for the whole array145 // TODO instead of manually doing this check for the whole array
145 // and turning off runtime safety, the compiler should detect loops like146 // 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 {...@@ -152,7 +153,7 @@ pub fn copy(comptime T: type, dest: []T, source: []const T) void {
152153
153/// Copy all of source into dest at position 0.154/// Copy all of source into dest at position 0.
154/// dest.len must be >= source.len.155/// dest.len must be >= source.len.
155/// dest.ptr must be >= src.ptr.156/// If the slices overlap, dest.ptr must be >= src.ptr.
156pub fn copyBackwards(comptime T: type, dest: []T, source: []const T) void {157pub fn copyBackwards(comptime T: type, dest: []T, source: []const T) void {
157 // TODO instead of manually doing this check for the whole array158 // TODO instead of manually doing this check for the whole array
158 // and turning off runtime safety, the compiler should detect loops like159 // and turning off runtime safety, the compiler should detect loops like