| 752 | } |
| 753 | |
| 754 | void LIRSCacheShard::UninitializedToProtected(LIRSThreadState* tstate, LIRSHandle* e) { |
| 755 | DCHECK(!e->unprotected_tombstone_list_hook_.is_linked()); |
| 756 | DCHECK(!e->recency_list_hook_.is_linked()); |
| 757 | e->set_state(UNINITIALIZED, PROTECTED); |
| 758 | HandleBase* existing = table_.Insert(e); |
| 759 | DCHECK(existing == nullptr); |
| 760 | recency_list_.push_back(*e); |
| 761 | // List operations happen before changes to the counts/usage |
| 762 | ++num_protected_; |
| 763 | protected_usage_ += e->charge(); |
| 764 | EnforceProtectedCapacity(tstate); |
| 765 | } |
| 766 | |
| 767 | bool LIRSCacheShard::UninitializedToUnprotected(LIRSThreadState* tstate, LIRSHandle* e) { |
| 768 | DCHECK(!e->unprotected_tombstone_list_hook_.is_linked()); |