diff options
author | bunnei <bunneidev@gmail.com> | 2020-08-05 20:22:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-05 20:22:36 +0200 |
commit | 4a2d9c6454dba4d5322efe520ed4611ed92eac26 (patch) | |
tree | d58fca590d5c2a77134347ca2cbc8f87445029b3 /src/core/memory.cpp | |
parent | Merge pull request #4466 from ogniK5377/loader-type-safe (diff) | |
parent | common/atomic_ops: Don't cast away volatile from pointers (diff) | |
download | yuzu-4a2d9c6454dba4d5322efe520ed4611ed92eac26.tar yuzu-4a2d9c6454dba4d5322efe520ed4611ed92eac26.tar.gz yuzu-4a2d9c6454dba4d5322efe520ed4611ed92eac26.tar.bz2 yuzu-4a2d9c6454dba4d5322efe520ed4611ed92eac26.tar.lz yuzu-4a2d9c6454dba4d5322efe520ed4611ed92eac26.tar.xz yuzu-4a2d9c6454dba4d5322efe520ed4611ed92eac26.tar.zst yuzu-4a2d9c6454dba4d5322efe520ed4611ed92eac26.zip |
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r-- | src/core/memory.cpp | 10 |
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(); |