Bug #617
LRUCache::GetFoundSize always returns zero
Status: | Approved | Start date: | 12/27/2013 | |
---|---|---|---|---|
Priority: | Low | Due date: | ||
Assignee: | Jan Dolinár | % Done: | 0% | |
Category: | Core | Spent time: | - | |
Target version: | - |
Description
I don't really understand the code in LRUCache, especially the reasons behind flag and Item::flag. But I strongly suspect there is some bug in the code in LRUCache<T, K>::Get that takes care about incrementing the foundsize counter. Right now it probably only counts each retrieval once and even after ClearCounters was called. That doesn't really match the description.
As I already said, I don't really understand the logic that lead to using the flag variables :-) Nevertheless, I attach a patch eliminates them and that also seems to make the LRUCache behave as documented. Of course, if you can think of better solution, I won't mind :)
History
#1 Updated by Miroslav Fidler over 11 years ago
- Status changed from New to Ready for QA
- Assignee changed from Miroslav Fidler to Jan Dolinár
I agree that documentation is misleading. Anyway, the intent is to know how much data in the cache was reused (since last ClearCounters) and how much data was added. This is a good thing to know to estimate the cache growth.
I will try to reword documentation.
#2 Updated by Miroslav Fidler about 11 years ago
- Status changed from Ready for QA to Approved