1 write to _options
Microsoft.Extensions.Caching.Memory (1)
20 references to _options
Microsoft.Extensions.Caching.Memory (20)
MemoryCache.cs (20)
70if (_options.TrackStatistics)
77Tags = [new("dotnet.cache.name", _options.Name)]
83TrackLinkedCacheEntries = _options.TrackLinkedCacheEntries; // we store the setting now so it's consistent for entire MemoryCache lifetime
86private DateTime UtcNow => _options.Clock?.UtcNow.UtcDateTime ?? DateTime.UtcNow;
131if (_options.HasSizeLimit && entry.Size < 0)
133throw new InvalidOperationException(SR.Format(SR.CacheEntryHasEmptySize, nameof(entry.Size), nameof(_options.SizeLimit)));
164coherentState.RemoveEntry(priorEntry, _options);
195if (_options.HasSizeLimit)
213coherentState.RemoveEntry(priorEntry, _options);
315if (coherentState.RemoveEntry(entry, _options) && _allStats is not null)
348if (_options.HasSizeLimit)
389CurrentEstimatedSize = _options.HasSizeLimit ? Size : null,
400if (_coherentState.RemoveEntry(entry, _options) && _allStats is not null)
413if (_options.ExpirationScanFrequency < utcNow - _lastExpirationScan)
513if (coherentState.RemoveEntry(entry, _options) && _allStats is not null)
531long sizeLimit = _options.SizeLimitValue;
596long sizeLimit = _options.SizeLimitValue;
599long lowWatermark = sizeLimit - (long)(sizeLimit * _options.CompactionPercentage);
670if (coherentState.RemoveEntry(entry, _options))
886KeyValuePair<string, object?> cacheNameTag = new("dotnet.cache.name", _options.Name);