System: Reinitialize code cache on hw settings change/disc swap

Basically, anything which could allocate large amounts of memory and
potentially overlap with our fastmem area.
This commit is contained in:
Connor McLaughlin 2020-12-05 13:40:44 +10:00
parent 1c9d0967b1
commit 8b3426a96e
2 changed files with 7 additions and 0 deletions

View file

@ -660,6 +660,9 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
g_settings.display_line_start_offset != old_settings.display_line_start_offset ||
g_settings.display_line_end_offset != old_settings.display_line_end_offset)
{
if (g_settings.IsUsingCodeCache())
CPU::CodeCache::Reinitialize();
g_gpu->UpdateSettings();
}

View file

@ -1609,6 +1609,10 @@ bool InsertMedia(const char* path)
UpdateMemoryCards();
}
// reinitialize recompiler, because especially with preloading this might overlap the fastmem area
if (g_settings.IsUsingCodeCache())
CPU::CodeCache::Reinitialize();
return true;
}