-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly count number of items in LRU #8742
Conversation
I think, moving increment count into static add function builders may be a problem, and may cause incrementing count way above real value at startup with many concurrent operations.
|
I have put together a quick test app. Added a CacheCount property to LRU class that returns actual item count in cache to demonstrate what i meant. |
Thanks for catching that, this indeed seems to be an issue. I've updated this PR to use the logic as you proposed. |
* Updated test to reflect counting issue * Only increment and adjust size on Add * Updated LRU count computation logic
@mikescandy Release is out with the updates:
|
Fixes #8741
Microsoft Reviewers: Open in CodeFlow