diff options
| author | 2018-07-24 11:51:10 -0400 | |
|---|---|---|
| committer | 2018-07-24 11:56:30 -0400 | |
| commit | bf608f125eeb80a79fae20d98413cca1dbfdd486 (patch) | |
| tree | 433db385d100acb4f58e0dfa53aabf7339c45073 /src | |
| parent | video_core/memory_manager: Avoid repeated unnecessary page slot lookups (diff) | |
| download | yuzu-bf608f125eeb80a79fae20d98413cca1dbfdd486.tar.gz yuzu-bf608f125eeb80a79fae20d98413cca1dbfdd486.tar.xz yuzu-bf608f125eeb80a79fae20d98413cca1dbfdd486.zip | |
video_core/memory_manager: Replace a loop with std::array's fill() function in PageSlot()
We already have a function that does what this code was doing, so let's
use that instead.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/memory_manager.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index 98a6ca040..ca923d17d 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp | |||
| @@ -138,9 +138,7 @@ VAddr& MemoryManager::PageSlot(GPUVAddr gpu_addr) { | |||
| 138 | auto& block = page_table[(gpu_addr >> (PAGE_BITS + PAGE_TABLE_BITS)) & PAGE_TABLE_MASK]; | 138 | auto& block = page_table[(gpu_addr >> (PAGE_BITS + PAGE_TABLE_BITS)) & PAGE_TABLE_MASK]; |
| 139 | if (!block) { | 139 | if (!block) { |
| 140 | block = std::make_unique<PageBlock>(); | 140 | block = std::make_unique<PageBlock>(); |
| 141 | for (unsigned index = 0; index < PAGE_BLOCK_SIZE; index++) { | 141 | block->fill(static_cast<VAddr>(PageStatus::Unmapped)); |
| 142 | (*block)[index] = static_cast<u64>(PageStatus::Unmapped); | ||
| 143 | } | ||
| 144 | } | 142 | } |
| 145 | return (*block)[(gpu_addr >> PAGE_BITS) & PAGE_BLOCK_MASK]; | 143 | return (*block)[(gpu_addr >> PAGE_BITS) & PAGE_BLOCK_MASK]; |
| 146 | } | 144 | } |