2 instantiations of Stats
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
60_accumulatedStats = new Stats(); 61_stats = new ThreadLocal<Stats>(() => new Stats(this));
12 references to Stats
Microsoft.Extensions.Caching.Memory (12)
MemoryCache.cs (12)
28private readonly List<WeakReference<Stats>>? _allStats; 29private readonly Stats? _accumulatedStats; 30private readonly ThreadLocal<Stats>? _stats; 59_allStats = new List<WeakReference<Stats>>(); 61_stats = new ThreadLocal<Stats>(() => new Stats(this)); 361foreach (WeakReference<Stats> wr in _allStats) 363if (wr.TryGetTarget(out Stats? stats)) 374private Stats GetStats() => _stats!.Value!; 393private void RemoveFromStats(Stats current) 399if (!_allStats[i].TryGetTarget(out Stats? stats)) 412private void AddToStats(Stats current) 416_allStats.Add(new WeakReference<Stats>(current));