| 547 | } |
| 548 | |
| 549 | void LIRSCacheShard::EnforceProtectedCapacity(LIRSThreadState* tstate) { |
| 550 | while (protected_usage_ > protected_capacity_) { |
| 551 | DCHECK(!recency_list_.empty()); |
| 552 | // Get pointer to oldest entry and remove it |
| 553 | LIRSHandle* oldest = &recency_list_.front(); |
| 554 | // The oldest entry must be protected (i.e. the recency list must be trimmed) |
| 555 | DCHECK_EQ(oldest->state(), PROTECTED); |
| 556 | ProtectedToUnprotected(tstate, oldest); |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | void LIRSCacheShard::TrimRecencyList(LIRSThreadState* tstate) { |
| 561 | // This function maintains the invariant that the oldest entry in the list must be |