Bug #617

LRUCache::GetFoundSize always returns zero

Added by Jan Dolinár over 10 years ago. Updated about 10 years ago.

Status:ApprovedStart date:12/27/2013
Priority:LowDue date:
Assignee:Jan Dolinár% Done:

0%

Category:CoreSpent 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 :)

Other.h.patch Magnifier (843 Bytes) Jan Dolinár, 12/27/2013 09:35 PM

History

#1 Updated by Miroslav Fidler over 10 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 10 years ago

  • Status changed from Ready for QA to Approved

Also available in: Atom PDF