Skip to content
Snippets Groups Projects
Commit bf608f12 authored by Lioncash's avatar Lioncash
Browse files

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.
parent d71e19fd
No related branches found
No related tags found
No related merge requests found
...@@ -138,9 +138,7 @@ VAddr& MemoryManager::PageSlot(GPUVAddr gpu_addr) { ...@@ -138,9 +138,7 @@ VAddr& MemoryManager::PageSlot(GPUVAddr gpu_addr) {
auto& block = page_table[(gpu_addr >> (PAGE_BITS + PAGE_TABLE_BITS)) & PAGE_TABLE_MASK]; auto& block = page_table[(gpu_addr >> (PAGE_BITS + PAGE_TABLE_BITS)) & PAGE_TABLE_MASK];
if (!block) { if (!block) {
block = std::make_unique<PageBlock>(); block = std::make_unique<PageBlock>();
for (unsigned index = 0; index < PAGE_BLOCK_SIZE; index++) { block->fill(static_cast<VAddr>(PageStatus::Unmapped));
(*block)[index] = static_cast<u64>(PageStatus::Unmapped);
}
} }
return (*block)[(gpu_addr >> PAGE_BITS) & PAGE_BLOCK_MASK]; return (*block)[(gpu_addr >> PAGE_BITS) & PAGE_BLOCK_MASK];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment