diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2022-12-03 18:09:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-03 18:09:21 +0100 |
commit | 22aff09b33941cdf907e474cb86117fef838abba (patch) | |
tree | 73a747be44fd2ba994c3d40c8f6ea18633c0f880 /src/core/hle/kernel/k_slab_heap.h | |
parent | Merge pull request #9353 from vonchenplus/draw_indexed (diff) | |
parent | general: fix compile for Apple Clang (diff) | |
download | yuzu-22aff09b33941cdf907e474cb86117fef838abba.tar yuzu-22aff09b33941cdf907e474cb86117fef838abba.tar.gz yuzu-22aff09b33941cdf907e474cb86117fef838abba.tar.bz2 yuzu-22aff09b33941cdf907e474cb86117fef838abba.tar.lz yuzu-22aff09b33941cdf907e474cb86117fef838abba.tar.xz yuzu-22aff09b33941cdf907e474cb86117fef838abba.tar.zst yuzu-22aff09b33941cdf907e474cb86117fef838abba.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_slab_heap.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_slab_heap.h b/src/core/hle/kernel/k_slab_heap.h index a8c77a7d4..68469b041 100644 --- a/src/core/hle/kernel/k_slab_heap.h +++ b/src/core/hle/kernel/k_slab_heap.h @@ -6,6 +6,7 @@ #include <atomic> #include "common/assert.h" +#include "common/atomic_ops.h" #include "common/common_funcs.h" #include "common/common_types.h" #include "common/spin_lock.h" @@ -82,16 +83,13 @@ private: private: void UpdatePeakImpl(uintptr_t obj) { - static_assert(std::atomic_ref<uintptr_t>::is_always_lock_free); - std::atomic_ref<uintptr_t> peak_ref(m_peak); - const uintptr_t alloc_peak = obj + this->GetObjectSize(); uintptr_t cur_peak = m_peak; do { if (alloc_peak <= cur_peak) { break; } - } while (!peak_ref.compare_exchange_strong(cur_peak, alloc_peak)); + } while (!Common::AtomicCompareAndSwap(&m_peak, alloc_peak, cur_peak, cur_peak)); } public: |