Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libc/src/string/memory_utils/aarch64/inline_strlen.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
namespace LIBC_NAMESPACE_DECL {

namespace neon {
[[gnu::no_sanitize_address]] [[maybe_unused]] LIBC_INLINE static size_t
__attribute__((no_sanitize("address", "hwaddress", "thread")))
[[maybe_unused]] LIBC_INLINE static size_t
string_length(const char *src) {
using Vector __attribute__((may_alias)) = uint8x8_t;

Expand Down
3 changes: 2 additions & 1 deletion libc/src/string/memory_utils/generic/inline_strlen.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ LIBC_INLINE constexpr cpp::simd_mask<char> shift_mask(cpp::simd_mask<char> m,
return cpp::bit_cast<cpp::simd_mask<char>>(r);
}

[[clang::no_sanitize("address")]] LIBC_INLINE size_t
__attribute__((no_sanitize("address", "hwaddress", "thread")))
LIBC_INLINE size_t
string_length(const char *src) {
constexpr cpp::simd<char> null_byte = cpp::splat('\0');

Expand Down
6 changes: 4 additions & 2 deletions libc/src/string/memory_utils/x86_64/inline_strlen.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ namespace LIBC_NAMESPACE_DECL {
namespace string_length_internal {
// Return a bit-mask with the nth bit set if the nth-byte in block_ptr is zero.
template <typename Vector, typename Mask>
[[gnu::no_sanitize_address]] LIBC_INLINE static Mask
__attribute__((no_sanitize("address", "hwaddress", "thread")))
LIBC_INLINE static Mask
compare_and_mask(const Vector *block_ptr);

template <typename Vector, typename Mask,
decltype(compare_and_mask<Vector, Mask>)>
[[gnu::no_sanitize_address]] LIBC_INLINE static size_t
__attribute__((no_sanitize("address", "hwaddress", "thread")))
LIBC_INLINE static size_t
string_length_vector(const char *src) {
uintptr_t misalign_bytes = reinterpret_cast<uintptr_t>(src) % sizeof(Vector);

Expand Down
3 changes: 2 additions & 1 deletion libc/src/string/string_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ template <typename T> LIBC_INLINE size_t string_length(const T *src) {
}

template <typename Word>
[[gnu::no_sanitize_address]] LIBC_INLINE void *
__attribute__((no_sanitize("address", "hwaddress", "thread")))
LIBC_INLINE void *
find_first_character_wide_read(const unsigned char *src, unsigned char ch,
size_t n) {
const unsigned char *char_ptr = src;
Expand Down
Loading