Go to the documentation of this file.
22 #ifndef ABSL_BASE_OPTIMIZATION_H_
23 #define ABSL_BASE_OPTIMIZATION_H_
27 #include "absl/base/config.h"
42 #if defined(__pnacl__)
43 #define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() if (volatile int x = 0) { (void)x; }
44 #elif defined(__clang__)
46 #define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__("")
47 #elif defined(__GNUC__)
49 #define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__("")
50 #elif defined(_MSC_VER)
53 #define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __nop()
55 #define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() if (volatile int x = 0) { (void)x; }
75 #if defined(__i386__) || defined(__x86_64__)
76 #define ABSL_CACHELINE_SIZE 64
77 #elif defined(__powerpc64__)
78 #define ABSL_CACHELINE_SIZE 128
79 #elif defined(__aarch64__)
82 #define ABSL_CACHELINE_SIZE 64
83 #elif defined(__arm__)
88 #if defined(__ARM_ARCH_5T__)
89 #define ABSL_CACHELINE_SIZE 32
90 #elif defined(__ARM_ARCH_7A__)
91 #define ABSL_CACHELINE_SIZE 64
95 #ifndef ABSL_CACHELINE_SIZE
98 #define ABSL_CACHELINE_SIZE 64
144 #define ABSL_CACHELINE_ALIGNED __attribute__((aligned(ABSL_CACHELINE_SIZE)))
145 #elif defined(_MSC_VER)
146 #define ABSL_CACHELINE_SIZE 64
147 #define ABSL_CACHELINE_ALIGNED __declspec(align(ABSL_CACHELINE_SIZE))
149 #define ABSL_CACHELINE_SIZE 64
150 #define ABSL_CACHELINE_ALIGNED
175 #if ABSL_HAVE_BUILTIN(__builtin_expect) || \
176 (defined(__GNUC__) && !defined(__clang__))
177 #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
178 #define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
180 #define ABSL_PREDICT_FALSE(x) (x)
181 #define ABSL_PREDICT_TRUE(x) (x)
209 #define ABSL_ASSUME(cond) assert(cond)
210 #elif ABSL_HAVE_BUILTIN(__builtin_assume)
211 #define ABSL_ASSUME(cond) __builtin_assume(cond)
212 #elif defined(__GNUC__) || ABSL_HAVE_BUILTIN(__builtin_unreachable)
213 #define ABSL_ASSUME(cond) \
215 if (!(cond)) __builtin_unreachable(); \
217 #elif defined(_MSC_VER)
218 #define ABSL_ASSUME(cond) __assume(cond)
220 #define ABSL_ASSUME(cond) \
222 static_cast<void>(false && (cond)); \
243 #if defined(__GNUC__)
244 #define ABSL_INTERNAL_UNIQUE_SMALL_NAME2(x) #x
245 #define ABSL_INTERNAL_UNIQUE_SMALL_NAME1(x) ABSL_INTERNAL_UNIQUE_SMALL_NAME2(x)
246 #define ABSL_INTERNAL_UNIQUE_SMALL_NAME() \
247 asm(ABSL_INTERNAL_UNIQUE_SMALL_NAME1(.absl.__COUNTER__))
249 #define ABSL_INTERNAL_UNIQUE_SMALL_NAME()
252 #endif // ABSL_BASE_OPTIMIZATION_H_
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:35