We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ee0214 commit 95d6e0bCopy full SHA for 95d6e0b
Objects/obmalloc.c
@@ -1523,9 +1523,9 @@ PyObject_Free(void *ptr)
1523
}
1524
1525
1526
-/* If we're using GCC, use __builtin_expect() to reduce overhead of
+/* Use __builtin_expect() where available to reduce overhead of
1527
the valgrind checks */
1528
-#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
+#if (defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 2))) && defined(__OPTIMIZE__)
1529
# define UNLIKELY(value) __builtin_expect((value), 0)
1530
# define LIKELY(value) __builtin_expect((value), 1)
1531
#else
0 commit comments