Skip to content

Commit 6f99a06

Browse files
[libc] address CRs
1 parent 88d0f00 commit 6f99a06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libc/src/__support/OSUtil/linux/syscall.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "src/__support/CPP/bit.h"
1313
#include "src/__support/common.h"
1414
#include "src/__support/macros/config.h"
15+
#include "src/__support/macros/optimization.h"
1516
#include "src/__support/macros/properties/architectures.h"
1617

1718
#ifdef LIBC_TARGET_ARCH_IS_X86_32
@@ -43,8 +44,7 @@ LIBC_INLINE_VAR constexpr unsigned long MAX_ERRNO = 4095;
4344
template <typename PointerLike>
4445
LIBC_INLINE constexpr bool is_valid_mmap(PointerLike ptr) {
4546
long addr = cpp::bit_cast<long>(ptr);
46-
return __builtin_expect(addr > 0 || addr < -cpp::bit_cast<long>(MAX_ERRNO),
47-
true);
47+
return LIBC_LIKELY(addr > 0 || addr < -static_cast<long>(MAX_ERRNO));
4848
}
4949
} // namespace linux_utils
5050

0 commit comments

Comments
 (0)