summaryrefslogtreecommitdiff
path: root/absl/base
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-10-07 10:27:28 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-10-07 10:28:24 -0700
commitd870260579a0f032548fc79dcb4ba7e2114be9f3 (patch)
tree4fd4adac087ea93389cd11859ee16def551240f9 /absl/base
parent8317b9a01cbc32594ad4bf971709c97cb13ec921 (diff)
Configure ABSL_CACHE_ALIGNED for clang-like and MSVC toolchains.
PiperOrigin-RevId: 479614832 Change-Id: I440d145172c93cc4043aeda36898877a331ed5ff
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/optimization.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/base/optimization.h b/absl/base/optimization.h
index db5cc097..d706100c 100644
--- a/absl/base/optimization.h
+++ b/absl/base/optimization.h
@@ -91,6 +91,7 @@
#define ABSL_CACHELINE_SIZE 64
#endif
#endif
+#endif
#ifndef ABSL_CACHELINE_SIZE
// A reasonable default guess. Note that overestimates tend to waste more
@@ -141,12 +142,11 @@
// the generated machine code.
// 3) Prefer applying this attribute to individual variables. Avoid
// applying it to types. This tends to localize the effect.
+#if defined(__clang__) || defined(__GNUC__)
#define ABSL_CACHELINE_ALIGNED __attribute__((aligned(ABSL_CACHELINE_SIZE)))
#elif defined(_MSC_VER)
-#define ABSL_CACHELINE_SIZE 64
#define ABSL_CACHELINE_ALIGNED __declspec(align(ABSL_CACHELINE_SIZE))
#else
-#define ABSL_CACHELINE_SIZE 64
#define ABSL_CACHELINE_ALIGNED
#endif