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

[Common.hpp] fix CACHE_LINE_EXCLUSIVE macro

The macro did not replace symbol in __symbol_mem and always
created the literal symbol __symbol_mem which makes the
macro unusable in the same scope twice.
parent 7ae0f69b
No related branches found
No related tags found
No related merge requests found
...@@ -32,8 +32,8 @@ using func_t = std::function<void()>; ...@@ -32,8 +32,8 @@ using func_t = std::function<void()>;
#define ALIGN_TO_CACHE_LINE alignas(64) #define ALIGN_TO_CACHE_LINE alignas(64)
#define CACHE_LINE_EXCLUSIVE(T, symbol) \ #define CACHE_LINE_EXCLUSIVE(T, symbol) \
std::aligned_storage<64, 64>::type __symbol_mem; \ std::aligned_storage<64, 64>::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