flipped the if/else blocks for better branch prediction

This commit is contained in:
unknown 2015-07-18 12:51:44 -04:00
parent 62d316f7ae
commit 188091e32a
1 changed files with 6 additions and 6 deletions

View File

@ -5379,18 +5379,18 @@ void CMipsMemoryVM::RdramChanged ( CMipsMemoryVM * _this )
{ {
return; return;
} }
if (old_size == 0x400000) if (old_size == 0x800000)
{
VirtualFree(_this->m_RDRAM + 0x400000, 0x400000, MEM_DECOMMIT);
}
else
{ {
if (VirtualAlloc(_this->m_RDRAM + 0x400000, 0x400000, MEM_COMMIT, PAGE_READWRITE)==NULL) if (VirtualAlloc(_this->m_RDRAM + 0x400000, 0x400000, MEM_COMMIT, PAGE_READWRITE)==NULL)
{ {
WriteTrace(TraceError,__FUNCTION__ ": failed to allocate extended memory"); WriteTrace(TraceError,__FUNCTION__ ": failed to allocate extended memory");
g_Notify->FatalError(GS(MSG_MEM_ALLOC_ERROR)); g_Notify -> FatalError(GS(MSG_MEM_ALLOC_ERROR));
} }
} }
else
{
VirtualFree(_this->m_RDRAM + 0x400000, 0x400000,MEM_DECOMMIT);
}
_this->m_AllocatedRdramSize = new_size; _this->m_AllocatedRdramSize = new_size;
} }