| ... | @@ -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 unaligned | 975 | // 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; |