mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 09:00:17 +02:00
LookupCache: Clear L1 entries on dynamic cache growth
Growing widens L1PointerMask without touching the table, so an entry whose address has the new mask bit set sits where InvalidateCache no longer looks, and a later shrink hands it back to the JIT. Wipe [0, old) on grow, the way the shrink wipes [new, MAX); the still-valid entries go with it.
This commit is contained in:
1 parent
4ed80fd071
commit
7e3e4f81ac
1 file changed
+3
@@ -242,6 +242,9 @@ public:
|
||||
|
||||
if (AveragePerSecond >= DynamicL1CacheIncreaseCountHeuristic()) {
|
||||
if (CurrentL1Entries < MAX_L1_ENTRIES) {
|
||||
// Entries whose address has the new mask bit set would be unreachable by InvalidateCache
|
||||
FEXCore::Allocator::VirtualDontNeed(reinterpret_cast<void*>(L1Pointer), CurrentL1Entries * sizeof(LookupCacheEntry), false);
|
||||
|
||||
CurrentL1Entries <<= 1;
|
||||
L1PointerMask = CurrentL1Entries - 1;
|
||||
|
||||
|
||||
Reference in new issue
Block a user