summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-07-28 10:32:39 +0200
committerLioncash <mathew1800@gmail.com>2020-07-28 10:36:53 +0200
commite3f0c9323039bd1148a8e36a31b468a871971fbb (patch)
tree67f4d007c3d6c887f9f8439879e9904a890d12e9 /src/core
parentMerge pull request #4437 from lioncash/ptr (diff)
downloadyuzu-e3f0c9323039bd1148a8e36a31b468a871971fbb.tar
yuzu-e3f0c9323039bd1148a8e36a31b468a871971fbb.tar.gz
yuzu-e3f0c9323039bd1148a8e36a31b468a871971fbb.tar.bz2
yuzu-e3f0c9323039bd1148a8e36a31b468a871971fbb.tar.lz
yuzu-e3f0c9323039bd1148a8e36a31b468a871971fbb.tar.xz
yuzu-e3f0c9323039bd1148a8e36a31b468a871971fbb.tar.zst
yuzu-e3f0c9323039bd1148a8e36a31b468a871971fbb.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/memory.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 2c5588933..86d17c6cb 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -704,7 +704,7 @@ struct Memory::Impl {
u8* page_pointer = current_page_table->pointers[vaddr >> PAGE_BITS];
if (page_pointer != nullptr) {
// NOTE: Avoid adding any extra logic to this fast-path block
- T volatile* pointer = reinterpret_cast<T volatile*>(&page_pointer[vaddr]);
+ auto* pointer = reinterpret_cast<volatile T*>(&page_pointer[vaddr]);
return Common::AtomicCompareAndSwap(pointer, data, expected);
}
@@ -720,9 +720,8 @@ struct Memory::Impl {
case Common::PageType::RasterizerCachedMemory: {
u8* host_ptr{GetPointerFromRasterizerCachedMemory(vaddr)};
system.GPU().InvalidateRegion(vaddr, sizeof(T));
- T volatile* pointer = reinterpret_cast<T volatile*>(&host_ptr);
+ auto* pointer = reinterpret_cast<volatile T*>(&host_ptr);
return Common::AtomicCompareAndSwap(pointer, data, expected);
- break;
}
default:
UNREACHABLE();
@@ -734,7 +733,7 @@ struct Memory::Impl {
u8* const page_pointer = current_page_table->pointers[vaddr >> PAGE_BITS];
if (page_pointer != nullptr) {
// NOTE: Avoid adding any extra logic to this fast-path block
- u64 volatile* pointer = reinterpret_cast<u64 volatile*>(&page_pointer[vaddr]);
+ auto* pointer = reinterpret_cast<volatile u64*>(&page_pointer[vaddr]);
return Common::AtomicCompareAndSwap(pointer, data, expected);
}
@@ -750,9 +749,8 @@ struct Memory::Impl {
case Common::PageType::RasterizerCachedMemory: {
u8* host_ptr{GetPointerFromRasterizerCachedMemory(vaddr)};
system.GPU().InvalidateRegion(vaddr, sizeof(u128));
- u64 volatile* pointer = reinterpret_cast<u64 volatile*>(&host_ptr);
+ auto* pointer = reinterpret_cast<volatile u64*>(&host_ptr);
return Common::AtomicCompareAndSwap(pointer, data, expected);
- break;
}
default:
UNREACHABLE();