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.
This commit is contained in:
Lioncash 2018-07-24 11:51:10 -04:00
parent d71e19fd75
commit bf608f125e

View file

@ -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];
} }