Open rgacogne opened 3 years ago
I tried this on OpenBSD (clang 11) but it does not seem to have this symbol, even though it claims C++17 support.
The test program bewlo also fails on Buster using gcc 11:
x.cc: In function ‘int main()’:
x.cc:5:21: error: ‘hardware_destructive_interference_size’ is not a member of ‘std’
5 | std::cout << std::hardware_destructive_interference_size << std::endl;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <new>
#include <iostream>
int main()
{
std::cout << std::hardware_destructive_interference_size << std::endl;
return 0;
}
Short description
9998 used
CPU_LEVEL1_DCACHE_LINESIZE
because we were still using C++11 andstd::hardware_destructive_interference_size
requires C++17, but we are now using C++17 so in theory we could do better a determining the required padding size to prevent false sharing.