authorgravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2024-01-01 16:25:17+01:00
committergravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2024-01-01 16:25:17+01:00
log564b1da2144a94fd3cf4c66614968d8b669bc26f
tree4de39482ed95116f9ed36b7aeae824c96664e796
parent59ac0d1eed561483b4d97145eafa7d0763fb8ed8

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


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

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