CPU/CodeCache: Clear blocks on system shutdown

Means we release all allocated memory on system shutdown, rather
than waiting until the next VM/system start.
This commit is contained in:
Stenzek 2024-11-05 13:06:44 +10:00
parent d0ad4e7264
commit 8bd0e6c3f7
No known key found for this signature in database
3 changed files with 9 additions and 0 deletions

View File

@ -225,6 +225,11 @@ void CPU::CodeCache::Reset()
}
}
void CPU::CodeCache::Shutdown()
{
ClearBlocks();
}
void CPU::CodeCache::Execute()
{
if (IsUsingAnyRecompiler())

View File

@ -28,6 +28,9 @@ void ProcessShutdown();
/// Flushes the code cache, forcing all blocks to be recompiled.
void Reset();
/// Free all non-persistent resources for the code cache.
void Shutdown();
/// Invalidates all blocks which are in the range of the specified code page.
void InvalidateBlocksWithPageIndex(u32 page_index);

View File

@ -1975,6 +1975,7 @@ void System::DestroySystem()
CDROM::Shutdown();
g_gpu.reset();
DMA::Shutdown();
CPU::CodeCache::Shutdown();
CPU::PGXP::Shutdown();
CPU::Shutdown();
Bus::Shutdown();