Skip to content

Commit

Permalink
try to fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed Mar 9, 2024
1 parent f680b96 commit ca9bef1
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/common/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,15 @@
#endif

#ifndef CACHE_LINE_SIZE
// To test behavior with non-native cache line size, e.g. for
// Bloom filters, set TEST_CACHE_LINE_SIZE to the desired test size.
// This disables ALIGN_AS to keep it from failing compilation.
#ifdef TEST_CACHE_LINE_SIZE
#define CACHE_LINE_SIZE TEST_CACHE_LINE_SIZE
#define ALIGN_AS(n) /*empty*/
#else
#if defined(__s390__)
#if defined(__GNUC__) && __GNUC__ < 7
#define CACHE_LINE_SIZE 64U
constexpr size_t CACHE_LINE_SIZE = 64U;
#else
#define CACHE_LINE_SIZE 256U
constexpr size_t CACHE_LINE_SIZE = 256U;
#endif
#elif defined(__powerpc__) || defined(__aarch64__)
#define CACHE_LINE_SIZE 128U
constexpr size_t CACHE_LINE_SIZE = 128U;
#else
#define CACHE_LINE_SIZE 64U
#endif
#define ALIGN_AS(n) alignas(n)
constexpr size_t CACHE_LINE_SIZE = 64U;
#endif
#endif

0 comments on commit ca9bef1

Please sign in to comment.