Skip to content
Snippets Groups Projects

[Common] introduce a CACHE_LINE_SIZE define

Merged Florian Fischer requested to merge aj46ezos/emper:define-cacheline-size into master
1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
+ 4
3
@@ -30,9 +30,10 @@ using func_t = std::function<void()>;
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#define ALIGN_TO_CACHE_LINE alignas(64)
#define CACHE_LINE_EXCLUSIVE(T, symbol) \
std::aligned_storage<64, 64>::type __##symbol##_mem; \
#define CACHE_LINE_SIZE 64
#define ALIGN_TO_CACHE_LINE alignas(CACHE_LINE_SIZE)
#define CACHE_LINE_EXCLUSIVE(T, symbol) \
std::aligned_storage<CACHE_LINE_SIZE, CACHE_LINE_SIZE>::type __##symbol##_mem; \
T& symbol = *new (&__##symbol##_mem) T()
[[noreturn]] void die(const char* message, bool usePerror);
Loading