Devirtualize Register/Unregister and use a wrapper instead.

This commit is contained in:
Fernando Sahmkow 2019-02-27 20:36:06 -04:00 committed by FernandoS27
parent 5a9204dbd7
commit 7ea097e5c2
3 changed files with 8 additions and 12 deletions

View file

@ -104,7 +104,7 @@ protected:
}
/// Register an object into the cache
virtual void Register(const T& object) {
void Register(const T& object) {
object->SetIsRegistered(true);
interval_cache.add({GetInterval(object), ObjectSet{object}});
map_cache.insert({object->GetAddr(), object});
@ -112,7 +112,7 @@ protected:
}
/// Unregisters an object from the cache
virtual void Unregister(const T& object) {
void Unregister(const T& object) {
object->SetIsRegistered(false);
rasterizer.UpdatePagesCachedCount(object->GetAddr(), object->GetSizeInBytes(), -1);
// Only flush if use_accurate_gpu_emulation is enabled, as it incurs a performance hit