From 188091e32a2536dc4dad05d392908f976ba70487 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Jul 2015 12:51:44 -0400 Subject: [PATCH] flipped the if/else blocks for better branch prediction --- .../Project64/N64 System/Mips/Memory Virtual Mem.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 06a85da6d..afabe3497 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -5379,18 +5379,18 @@ void CMipsMemoryVM::RdramChanged ( CMipsMemoryVM * _this ) { 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) { 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; }