From 5bce81c3d6940acab92701ca284f4be79ae2a689 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 24 Aug 2020 00:37:54 -0400 Subject: [PATCH] memory_manager: Mark IsGranularRange() as a const member function This doesn't modify internal member state, so it can be marked as const. --- src/video_core/memory_manager.cpp | 4 ++-- src/video_core/memory_manager.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index 8441646459..7f97f889ad 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -312,10 +312,10 @@ void MemoryManager::CopyBlockUnsafe(GPUVAddr gpu_dest_addr, GPUVAddr gpu_src_add WriteBlockUnsafe(gpu_dest_addr, tmp_buffer.data(), size); } -bool MemoryManager::IsGranularRange(GPUVAddr gpu_addr, std::size_t size) { +bool MemoryManager::IsGranularRange(GPUVAddr gpu_addr, std::size_t size) const { const auto cpu_addr{GpuToCpuAddress(gpu_addr)}; if (!cpu_addr) { - return {}; + return false; } const std::size_t page{(*cpu_addr & Core::Memory::PAGE_MASK) + size}; return page <= Core::Memory::PAGE_SIZE; diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index 681bd95884..dbd2dba528 100644 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h @@ -109,7 +109,7 @@ public: /** * IsGranularRange checks if a gpu region can be simply read with a pointer. */ - bool IsGranularRange(GPUVAddr gpu_addr, std::size_t size); + bool IsGranularRange(GPUVAddr gpu_addr, std::size_t size) const; GPUVAddr Map(VAddr cpu_addr, GPUVAddr gpu_addr, std::size_t size); GPUVAddr MapAllocate(VAddr cpu_addr, std::size_t size, std::size_t align);