mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
mem: add @branchHint to indexOfSentinel
also seems to work around aarch64 LLVM miscompilation 🤔
This commit is contained in:
parent
95720f007b
commit
fc77678339
1 changed files with 1 additions and 0 deletions
|
|
@ -1119,6 +1119,7 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co
|
|||
|
||||
i += @divExact(std.mem.alignForward(usize, start_addr, block_size) - start_addr, @sizeOf(T));
|
||||
} else {
|
||||
@branchHint(.unlikely);
|
||||
// Would read over a page boundary. Per-byte at a time until aligned or found.
|
||||
// 0.39% chance this branch is taken for 4K pages at 16b block length.
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue