There was an error while loading. Please reload this page.
1 parent 9cffcf6 commit d280d82Copy full SHA for d280d82
2 files changed
src/ds/bits.h
@@ -9,7 +9,11 @@
9
# define ALWAYSINLINE __forceinline
10
# define NOINLINE __declspec(noinline)
11
# define HEADER_GLOBAL __declspec(selectany)
12
+# define likely(x) !!(x)
13
+# define unlikely(x) !!(x)
14
#else
15
+# define likely(x) __builtin_expect(!!(x), 1)
16
+# define unlikely(x) __builtin_expect(!!(x), 0)
17
# include <cpuid.h>
18
# include <emmintrin.h>
19
# define ALWAYSINLINE __attribute__((always_inline))
src/mem/alloc.h
@@ -872,7 +872,7 @@ namespace snmalloc
872
inline void handle_message_queue()
873
{
874
// Inline the empty check, but not necessarily the full queue handling.
875
- if (message_queue().is_empty())
+ if (likely(message_queue().is_empty()))
876
return;
877
878
handle_message_queue_inner();
0 commit comments