Skip to content
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

1.2.2 patches #239

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
Adjust cache release logic when initial pointer has lowest timestamp …
…but high ref count
  • Loading branch information
Matthew V authored and Jon Meredith committed Aug 24, 2012
commit 07c95b6d20c18909ed4b86194b757b12e0b563e3
3 changes: 2 additions & 1 deletion util/cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ Cache::Handle* LRUCache::Insert(
for (cursor=lru_.next;
cursor!=&lru_; cursor=cursor->next)
{
if (timercmp(&cursor->last_access, &low_ptr->last_access, <) && cursor->refs <= 1)
if ((timercmp(&cursor->last_access, &low_ptr->last_access, <) && cursor->refs <= 1)
|| cursor->refs < low_ptr->refs)
low_ptr=cursor;
} // for
// removing item that still has active references is
Expand Down