mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 19:00:17 +02:00
Prevents invalidations being missed under the following circumstances: Thread A JITs block A into the global codebuffer, adding the guest to host mapping to its CodePages, thread A is then killed. Thread B then performs SMC on block A. An exception will be triggered but as CodePages was stored per-thread, and thread A is now killed when all threads are iterated over by the frontend to perform invalidations it will be missed. The accumulator is introduced to handle the case where multiple threads have the same code entry in their local caches but share the same codebuffer. Consider a thread C in the above example that also has block A in its cache, without an accumulator, when invalidating thread B the entrypoint of A is erased from the shared guest to host map. So when C is invalidated, the local cache entry for A is not removed since it was removed from CodePages when invalidating B.