authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-03-21 15:01:57-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-03-21 15:01:57-07:00
log4dc50151c4593d289ed903d8177f11d724e3ade0
treed54e1fd3eebebfa1d79443467c27bc87c09231be
parent33428fc6aaf40ac19051df3a6669561c84e9faf6

std.mem.indexOfSentinel: valgrind integration

this code returns false positives in Valgrind, so we fall back to the other implementation when running in valgrind. see #17717

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

lib/std/mem.zig+1
...@@ -1038,6 +1038,7 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co...@@ -1038,6 +1038,7 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co
1038 var i: usize = 0;1038 var i: usize = 0;
10391039
1040 if (backend_supports_vectors and1040 if (backend_supports_vectors and
1041 !std.debug.inValgrind() and // https://github.com/ziglang/zig/issues/17717
1041 !@inComptime() and1042 !@inComptime() and
1042 (@typeInfo(T) == .Int or @typeInfo(T) == .Float) and std.math.isPowerOfTwo(@bitSizeOf(T)))1043 (@typeInfo(T) == .Int or @typeInfo(T) == .Float) and std.math.isPowerOfTwo(@bitSizeOf(T)))
1043 {1044 {