| ... | @@ -13,7 +13,8 @@ const meta = std.meta; | ... | @@ -13,7 +13,8 @@ const meta = std.meta; |
| 13 | const trait = meta.trait; | 13 | const trait = meta.trait; |
| 14 | const testing = std.testing; | 14 | const testing = std.testing; |
| 15 | | 15 | |
| 16 | /// https://github.com/ziglang/zig/issues/2564 | 16 | /// Compile time known minimum page size. |
| | 17 | /// https://github.com/ziglang/zig/issues/4082 |
| 17 | pub const page_size = switch (builtin.arch) { | 18 | pub 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" { |
| 139 | | 140 | |
| 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. |
| 143 | pub fn copy(comptime T: type, dest: []T, source: []const T) void { | 144 | pub fn copy(comptime T: type, dest: []T, source: []const T) void { |
| 144 | // TODO instead of manually doing this check for the whole array | 145 | // TODO instead of manually doing this check for the whole array |
| 145 | // and turning off runtime safety, the compiler should detect loops like | 146 | // 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 { |
| 152 | | 153 | |
| 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. |
| 156 | pub fn copyBackwards(comptime T: type, dest: []T, source: []const T) void { | 157 | pub fn copyBackwards(comptime T: type, dest: []T, source: []const T) void { |
| 157 | // TODO instead of manually doing this check for the whole array | 158 | // TODO instead of manually doing this check for the whole array |
| 158 | // and turning off runtime safety, the compiler should detect loops like | 159 | // and turning off runtime safety, the compiler should detect loops like |