memory_manager: Allow GpuToCpuAddress to return a zero address.

- Rationale: It's up to the caller to handle this or assert.
This commit is contained in:
bunnei
2018-06-30 02:32:33 -04:00
parent ee67baba48
commit 3c7619ce84

View File

@@ -100,9 +100,10 @@ boost::optional<GPUVAddr> MemoryManager::FindFreeBlock(u64 size, u64 align) {
boost::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr gpu_addr) {
VAddr base_addr = PageSlot(gpu_addr);
ASSERT(base_addr != static_cast<u64>(PageStatus::Unmapped));
if (base_addr == static_cast<u64>(PageStatus::Allocated)) {
switch (static_cast<PageStatus>(base_addr)) {
case PageStatus::Unmapped:
case PageStatus::Allocated:
return {};
}