static void mVUresizeCache(mV, u32 size) { if (size >= (u32)mVUcacheMaxSize) { if (mVU->cacheSize==mVUcacheMaxSize) { // We can't grow the rec any larger, so just reset it and start over. //(if we don't reset, the rec will eventually crash) Console.WriteLn(Color_Magenta, "microVU%d: Cannot grow cache, size limit reached! [%dmb]. Resetting rec.", mVU->index, mVU->cacheSize/_1mb); mVU->reset(); return; } size = mVUcacheMaxSize; } if (mVU->cache) Console.WriteLn(Color_Green, "microVU%d: Attempting to resize Cache [%dmb]", mVU->index, size/_1mb); u8* cache = SysMmapEx(0, size, 0, (mVU->index ? "Micro VU1 RecCache" : "Micro VU0 RecCache")); if(!cache && !mVU->cache) throw Exception::OutOfMemory( wxsFormat( L"Micro VU%d recompiled code cache", mVU->index) ); if(!cache) { Console.Error("microVU%d Error - Cache Resize Failed...", mVU->index); mVU->reset(); return; } if (mVU->cache) { HostSys::Munmap(mVU->cache, mVU->cacheSize); ProfilerTerminateSource(isVU1?"mVU1 Rec":"mVU0 Rec"); } mVU->cache = cache; mVU->cacheSize = size; ProfilerRegisterSource(isVU1?"mVU1 Rec":"mVU0 Rec", mVU->cache, mVU->cacheSize); mVU->reset(); }
void RecompiledCodeReserve::_registerProfiler() { if (m_profiler_name.IsEmpty() || !IsOk()) return; ProfilerRegisterSource( m_profiler_name, m_baseptr, GetReserveSizeInBytes() ); m_profiler_registered = true; }