zig

fork of https://codeberg.org/ziglang/zig
Log | Tree | Refs | README | LICENSE

commit 564b1da2144a94fd3cf4c66614968d8b669bc26f (tree)
parent 59ac0d1eed561483b4d97145eafa7d0763fb8ed8
Author: Carl Ã…stholm <carl@astholm.se>
Date:   Mon,  1 Jan 2024 16:25:17 +0100

Change `<` to `<=` in `indexOfSentinel` SIMD path

Diffstat:
Mlib/std/mem.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/mem.zig b/lib/std/mem.zig @@ -975,7 +975,7 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co // First block may be unaligned const start_addr = @intFromPtr(&p[i]); const offset_in_page = start_addr & (std.mem.page_size - 1); - if (offset_in_page < std.mem.page_size - @sizeOf(Block)) { + if (offset_in_page <= std.mem.page_size - @sizeOf(Block)) { // Will not read past the end of a page, full block. const block: Block = p[i..][0..block_len].*; const matches = block == mask;