Fix of undefined hardware_destructive_interference_size
This commit is contained in:
parent
63ca221394
commit
2600ba71ad
1 changed files with 8 additions and 1 deletions
|
@ -36,6 +36,13 @@
|
|||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/lock_guard.hpp>
|
||||
|
||||
#ifdef __cpp_lib_hardware_interference_size
|
||||
using std::hardware_destructive_interference_size;
|
||||
#else
|
||||
// 64 bytes on x86-64 │ L1_CACHE_BYTES │ L1_CACHE_SHIFT │ __cacheline_aligned │ ...
|
||||
constexpr std::size_t hardware_destructive_interference_size = 64;
|
||||
#endif
|
||||
|
||||
// #define SLIC3R_DEBUG_SLICE_PROCESSING
|
||||
|
||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||
|
@ -365,7 +372,7 @@ public:
|
|||
private:
|
||||
struct CacheLineAlignedMutex
|
||||
{
|
||||
alignas(std::hardware_destructive_interference_size) std::mutex mutex;
|
||||
alignas(hardware_destructive_interference_size) std::mutex mutex;
|
||||
};
|
||||
std::array<CacheLineAlignedMutex, 64> m_mutexes;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue