mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-02 05:11:13 +08:00
Fix of undefined hardware_destructive_interference_size
This commit is contained in:
parent
63ca221394
commit
2600ba71ad
@ -36,6 +36,13 @@
|
|||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/lock_guard.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
|
// #define SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
|
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
@ -365,7 +372,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
struct CacheLineAlignedMutex
|
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;
|
std::array<CacheLineAlignedMutex, 64> m_mutexes;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user