| 639 | } |
| 640 | |
| 641 | void LIRSCacheShard::AddToUnprotectedList(LIRSHandle* e) { |
| 642 | DCHECK(!e->unprotected_tombstone_list_hook_.is_linked()); |
| 643 | DCHECK_EQ(e->state(), UNPROTECTED); |
| 644 | unprotected_tombstone_list_.push_back(*e); |
| 645 | // Updates to counts are always after list operations. If the list is empty, |
| 646 | // this count is zero. |
| 647 | if (num_unprotected_ == 0) { |
| 648 | DCHECK(unprotected_list_front_ == nullptr); |
| 649 | unprotected_list_front_ = e; |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | void LIRSCacheShard::RemoveFromUnprotectedList(LIRSHandle* e) { |
| 654 | DCHECK(e->unprotected_tombstone_list_hook_.is_linked()); |