From d2e10eb4b6c9b0aaa8e18e0b43cd9f1f09d23c61 Mon Sep 17 00:00:00 2001 From: Alex Peck Date: Fri, 10 Nov 2023 09:04:23 -0800 Subject: [PATCH] fix debugger display --- BitFaster.Caching/Lru/ConcurrentLruCore.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BitFaster.Caching/Lru/ConcurrentLruCore.cs b/BitFaster.Caching/Lru/ConcurrentLruCore.cs index 7f89c50e..c920fea9 100644 --- a/BitFaster.Caching/Lru/ConcurrentLruCore.cs +++ b/BitFaster.Caching/Lru/ConcurrentLruCore.cs @@ -826,7 +826,11 @@ private static CachePolicy CreatePolicy(ConcurrentLruCore lru) // it becomes immutable. However, this object is then somewhere else on the // heap, which slows down the policies with hit counter logic in benchmarks. Likely // this approach keeps the structs data members in the same CPU cache line as the LRU. +#if NETCOREAPP3_0_OR_GREATER [DebuggerDisplay("Hit = {Hits}, Miss = {Misses}, Upd = {Updated}, Evict = {Evicted}")] +#else + [DebuggerDisplay("Hit = {Hits}, Miss = {Misses}, Evict = {Evicted}")] +#endif private class Proxy : ICacheMetrics, ICacheEvents, IBoundedPolicy, ITimePolicy { private readonly ConcurrentLruCore lru;