diff options
author | Lioncash <mathew1800@gmail.com> | 2019-04-06 02:22:53 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-04-06 02:22:55 +0200 |
commit | 085b388a7aaa37663cec84d06a0c2cb674bee73a (patch) | |
tree | e32df29678742088d648acf71e3f314b9a47555b /src/video_core/memory_manager.cpp | |
parent | video_core/memory_manager: Make GpuToCpuAddress() a const member function (diff) | |
download | yuzu-085b388a7aaa37663cec84d06a0c2cb674bee73a.tar yuzu-085b388a7aaa37663cec84d06a0c2cb674bee73a.tar.gz yuzu-085b388a7aaa37663cec84d06a0c2cb674bee73a.tar.bz2 yuzu-085b388a7aaa37663cec84d06a0c2cb674bee73a.tar.lz yuzu-085b388a7aaa37663cec84d06a0c2cb674bee73a.tar.xz yuzu-085b388a7aaa37663cec84d06a0c2cb674bee73a.tar.zst yuzu-085b388a7aaa37663cec84d06a0c2cb674bee73a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/memory_manager.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index 124a3c6d2..11b1d022a 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -77,16 +77,17 @@ GPUVAddr MemoryManager::UnmapBuffer(GPUVAddr gpu_addr, u64 size) { return gpu_addr; } -GPUVAddr MemoryManager::FindFreeRegion(GPUVAddr region_start, u64 size) { +GPUVAddr MemoryManager::FindFreeRegion(GPUVAddr region_start, u64 size) const { // Find the first Free VMA. - const VMAHandle vma_handle{std::find_if(vma_map.begin(), vma_map.end(), [&](const auto& vma) { - if (vma.second.type != VirtualMemoryArea::Type::Unmapped) { - return false; - } - - const VAddr vma_end{vma.second.base + vma.second.size}; - return vma_end > region_start && vma_end >= region_start + size; - })}; + const VMAHandle vma_handle{ + std::find_if(vma_map.begin(), vma_map.end(), [region_start, size](const auto& vma) { + if (vma.second.type != VirtualMemoryArea::Type::Unmapped) { + return false; + } + + const VAddr vma_end{vma.second.base + vma.second.size}; + return vma_end > region_start && vma_end >= region_start + size; + })}; if (vma_handle == vma_map.end()) { return {}; |