diff --git a/Utilities/BEType.h b/Utilities/BEType.h index aaeadc21ae..a8072cd472 100644 --- a/Utilities/BEType.h +++ b/Utilities/BEType.h @@ -492,10 +492,10 @@ template using to_le_t = typename to_se::type; // BE/LE aliases for atomic_t -template -using atomic_be_t = atomic_t>; -template -using atomic_le_t = atomic_t>; +template +using atomic_be_t = atomic_t, Align>; +template +using atomic_le_t = atomic_t, Align>; template struct fmt_unveil, void> diff --git a/Utilities/types.h b/Utilities/types.h index 3e173df6af..a040aa400c 100644 --- a/Utilities/types.h +++ b/Utilities/types.h @@ -242,7 +242,7 @@ namespace fmt const fmt_type_info* get_type_info(); } -template +template class atomic_t; // Extract T::simple_type if available, remove cv qualifiers diff --git a/rpcs3/util/atomic.cpp b/rpcs3/util/atomic.cpp index ee76fb22d2..b5d48b3f12 100644 --- a/rpcs3/util/atomic.cpp +++ b/rpcs3/util/atomic.cpp @@ -93,9 +93,9 @@ static constexpr u32 s_max_conds = 512 * 64; static std::aligned_storage_t s_cond_list[s_max_conds]{}; -alignas(64) atomic_t s_cond_bits[s_max_conds / 64]; +atomic_t s_cond_bits[s_max_conds / 64]; -alignas(64) atomic_t s_cond_sema{0}; +atomic_t s_cond_sema{0}; static u32 cond_alloc() { @@ -281,7 +281,7 @@ static constexpr u32 s_slot_gcount = (s_hashtable_power > 7 ? 4096 : 256) / 64; alignas(64) static slot_info s_slot_list[s_slot_gcount * 64]{}; // Allocation bits -alignas(64) static atomic_t s_slot_bits[s_slot_gcount]{}; +static atomic_t s_slot_bits[s_slot_gcount]{}; static u64 slot_alloc() { diff --git a/rpcs3/util/atomic.hpp b/rpcs3/util/atomic.hpp index 4d0284b15d..73395057b5 100644 --- a/rpcs3/util/atomic.hpp +++ b/rpcs3/util/atomic.hpp @@ -18,7 +18,7 @@ enum class atomic_wait_timeout : u64 struct atomic_storage_futex { private: - template + template friend class atomic_t; static void wait(const void* data, std::size_t size, u64 old_value, u64 timeout, u64 mask); @@ -674,7 +674,7 @@ struct atomic_storage : atomic_storage }; // Atomic type with lock-free and standard layout guarantees (and appropriate limitations) -template +template class atomic_t { protected: @@ -684,7 +684,7 @@ protected: static_assert(alignof(type) == sizeof(type), "atomic_t<> error: unexpected alignment, use alignas() if necessary"); - type m_data; + alignas(Align) type m_data; public: atomic_t() noexcept = default;