mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
GH-131033: Enable the optimizing macros UNLIKELY and LIKELY for Clang (GH-131019)
This includes clang-cl on Windows, which does not define the GCC version that was previously being checked.
This commit is contained in:
parent
9ee0214b5d
commit
95d6e0b283
1 changed files with 2 additions and 2 deletions
|
|
@ -1523,9 +1523,9 @@ PyObject_Free(void *ptr)
|
|||
}
|
||||
|
||||
|
||||
/* If we're using GCC, use __builtin_expect() to reduce overhead of
|
||||
/* Use __builtin_expect() where available to reduce overhead of
|
||||
the valgrind checks */
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
|
||||
#if (defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 2))) && defined(__OPTIMIZE__)
|
||||
# define UNLIKELY(value) __builtin_expect((value), 0)
|
||||
# define LIKELY(value) __builtin_expect((value), 1)
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue