diff options
Diffstat (limited to 'src/common/host_memory.cpp')
| -rw-r--r-- | src/common/host_memory.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index e829af1ac..7f9659612 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #ifdef _WIN32 | 4 | #ifdef _WIN32 |
| 6 | 5 | ||
| @@ -149,7 +148,7 @@ public: | |||
| 149 | } | 148 | } |
| 150 | 149 | ||
| 151 | void Unmap(size_t virtual_offset, size_t length) { | 150 | void Unmap(size_t virtual_offset, size_t length) { |
| 152 | std::lock_guard lock{placeholder_mutex}; | 151 | std::scoped_lock lock{placeholder_mutex}; |
| 153 | 152 | ||
| 154 | // Unmap until there are no more placeholders | 153 | // Unmap until there are no more placeholders |
| 155 | while (UnmapOnePlaceholder(virtual_offset, length)) { | 154 | while (UnmapOnePlaceholder(virtual_offset, length)) { |
| @@ -169,7 +168,7 @@ public: | |||
| 169 | } | 168 | } |
| 170 | const size_t virtual_end = virtual_offset + length; | 169 | const size_t virtual_end = virtual_offset + length; |
| 171 | 170 | ||
| 172 | std::lock_guard lock{placeholder_mutex}; | 171 | std::scoped_lock lock{placeholder_mutex}; |
| 173 | auto [it, end] = placeholders.equal_range({virtual_offset, virtual_end}); | 172 | auto [it, end] = placeholders.equal_range({virtual_offset, virtual_end}); |
| 174 | while (it != end) { | 173 | while (it != end) { |
| 175 | const size_t offset = std::max(it->lower(), virtual_offset); | 174 | const size_t offset = std::max(it->lower(), virtual_offset); |