flipped the if/else blocks for better branch prediction
This commit is contained in:
parent
62d316f7ae
commit
188091e32a
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue