Commit d8702605 by Abseil Team Committed by Copybara-Service

Configure ABSL_CACHE_ALIGNED for clang-like and MSVC toolchains.

PiperOrigin-RevId: 479614832
Change-Id: I440d145172c93cc4043aeda36898877a331ed5ff
parent 8317b9a0
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
#define ABSL_CACHELINE_SIZE 64 #define ABSL_CACHELINE_SIZE 64
#endif #endif
#endif #endif
#endif
#ifndef ABSL_CACHELINE_SIZE #ifndef ABSL_CACHELINE_SIZE
// A reasonable default guess. Note that overestimates tend to waste more // A reasonable default guess. Note that overestimates tend to waste more
...@@ -141,12 +142,11 @@ ...@@ -141,12 +142,11 @@
// the generated machine code. // the generated machine code.
// 3) Prefer applying this attribute to individual variables. Avoid // 3) Prefer applying this attribute to individual variables. Avoid
// applying it to types. This tends to localize the effect. // applying it to types. This tends to localize the effect.
#if defined(__clang__) || defined(__GNUC__)
#define ABSL_CACHELINE_ALIGNED __attribute__((aligned(ABSL_CACHELINE_SIZE))) #define ABSL_CACHELINE_ALIGNED __attribute__((aligned(ABSL_CACHELINE_SIZE)))
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define ABSL_CACHELINE_SIZE 64
#define ABSL_CACHELINE_ALIGNED __declspec(align(ABSL_CACHELINE_SIZE)) #define ABSL_CACHELINE_ALIGNED __declspec(align(ABSL_CACHELINE_SIZE))
#else #else
#define ABSL_CACHELINE_SIZE 64
#define ABSL_CACHELINE_ALIGNED #define ABSL_CACHELINE_ALIGNED
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment