diff --git a/common/src/Utilities/Linux/LnxHostSys.cpp b/common/src/Utilities/Linux/LnxHostSys.cpp index f25d9d7c40..cdd9f7a783 100644 --- a/common/src/Utilities/Linux/LnxHostSys.cpp +++ b/common/src/Utilities/Linux/LnxHostSys.cpp @@ -178,21 +178,12 @@ bool HostSys::MmapCommitPtr(void *base, size_t size, const PageProtectionMode &m void HostSys::MmapResetPtr(void *base, size_t size) { - // On linux the only way to reset the memory is to unmap and remap it as PROT_NONE. - // That forces linux to unload all committed pages and start from scratch. + PageSizeAssertionTest(size); - // FIXME: Ideally this code would have some threading lock on it to prevent any other - // malloc/free code in the current process from interfering with the operation, but I - // can't think of any good way to do that. (generally it shouldn't be a problem in - // PCSX2 anyway, since MmapReset is only called when the ps2vm is suspended; so that - // pretty well stops all PCSX2 threads anyway). - - Munmap(base, size); - void *result = MmapReservePtr(base, size); + void *result = mmap(base, size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); pxAssertRel((uptr)result == (uptr)base, pxsFmt( - "Virtual memory decommit failed: memory at 0x%08X -> 0x%08X could not be remapped. " - "This is likely caused by multi-thread memory contention.", + "Virtual memory decommit failed: memory at 0x%08X -> 0x%08X could not be remapped.", base, (uptr)base + size)); } diff --git a/pcsx2/gui/RecentIsoList.cpp b/pcsx2/gui/RecentIsoList.cpp index a2b1377419..0f901b5026 100644 --- a/pcsx2/gui/RecentIsoList.cpp +++ b/pcsx2/gui/RecentIsoList.cpp @@ -89,7 +89,9 @@ void RecentIsoManager::RemoveAllFromMenu() if( m_Menu == NULL ) return; int cnt = m_Items.size(); - for( int i=0; i=0; --i ) { RecentItem& curitem( m_Items[i] ); if( curitem.ItemPtr == NULL ) continue;