Skip to content
Snippets Groups Projects
Commit e45bfb79 authored by Florian Fischer's avatar Florian Fischer
Browse files

[Common] introduce a CACHE_LINE_SIZE define

This define will be used in future patches.
parent 0ff7ac2e
No related branches found
No related tags found
No related merge requests found
...@@ -30,9 +30,10 @@ using func_t = std::function<void()>; ...@@ -30,9 +30,10 @@ using func_t = std::function<void()>;
#define likely(x) __builtin_expect(!!(x), 1) #define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0) #define unlikely(x) __builtin_expect(!!(x), 0)
#define ALIGN_TO_CACHE_LINE alignas(64) #define CACHE_LINE_SIZE 64
#define ALIGN_TO_CACHE_LINE alignas(CACHE_LINE_SIZE)
#define CACHE_LINE_EXCLUSIVE(T, symbol) \ #define CACHE_LINE_EXCLUSIVE(T, symbol) \
std::aligned_storage<64, 64>::type __##symbol##_mem; \ std::aligned_storage<CACHE_LINE_SIZE, CACHE_LINE_SIZE>::type __##symbol##_mem; \
T& symbol = *new (&__##symbol##_mem) T() T& symbol = *new (&__##symbol##_mem) T()
[[noreturn]] void die(const char* message, bool usePerror); [[noreturn]] void die(const char* message, bool usePerror);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment