LRUCache previously had a complexity of O(n). Reimplement using a `std::unordered_set` and a linked list to get this reduced to O(1). Renamed `LRUCache::query()` to `LRUCache::get()`, as this is a more common verb for a cache, and the `query()` suggests it is side effect free (when it actually makes the entry MRU). Move `LRUCache.hpp` from `src/Device` to `src/System` so it can be tested by `system-unittests`. Move the logic of `LRUSnapshotCache` into `VkDevice::SamplingRoutineCache`, as this was the only place it was used, and made it exceptionally hard to separate mutex-locked data from non-locked data. This is part of the work to get our code statically thread-safe-verifiable. Bug: b/153194656 Change-Id: Ie02888ae6c7ed4066df77d692dfae28c3bc1664d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43489Reviewed-by:Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Presubmit-Ready: Ben Clayton <bclayton@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| Linux | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| Build.cpp | Loading commit data... | |
| Build.hpp | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CPUID.cpp | Loading commit data... | |
| CPUID.hpp | Loading commit data... | |
| Configurator.cpp | Loading commit data... | |
| Configurator.hpp | Loading commit data... | |
| Debug.cpp | Loading commit data... | |
| Debug.hpp | Loading commit data... | |
| GrallocAndroid.cpp | Loading commit data... | |
| GrallocAndroid.hpp | Loading commit data... | |
| Half.cpp | Loading commit data... | |
| Half.hpp | Loading commit data... | |
| LRUCache.hpp | Loading commit data... | |
| Math.cpp | Loading commit data... | |
| Math.hpp | Loading commit data... | |
| Memory.cpp | Loading commit data... | |
| Memory.hpp | Loading commit data... | |
| SharedLibrary.hpp | Loading commit data... | |
| Socket.cpp | Loading commit data... | |
| Socket.hpp | Loading commit data... | |
| Synchronization.hpp | Loading commit data... | |
| Timer.cpp | Loading commit data... | |
| Timer.hpp | Loading commit data... | |
| Types.hpp | Loading commit data... |