| 1142 | } |
| 1143 | |
| 1144 | vector<HandleBase*> LIRSCacheShard::Dump() { |
| 1145 | DCHECK(initialized_); |
| 1146 | std::lock_guard<MutexType> l(mutex_); |
| 1147 | |
| 1148 | // For LIRS cache we only collect resident entries (i.e. PROTECTED/UNPROTECTED entries), |
| 1149 | // and ignore entries that are not resident (i.e. TOMBSTONE entries). |
| 1150 | vector<HandleBase*> handles; |
| 1151 | |
| 1152 | for (LIRSHandle& h : recency_list_) { |
| 1153 | // First walk through 'recency_list_', only collecting PROTECTED entries, ignoring |
| 1154 | // the UNPROTECTED/TOMBSTONE entries. UNPROTECTED entries will be collected later from |
| 1155 | // the unprotected_tombstone_list_. |
| 1156 | if (h.state() == PROTECTED) { |
| 1157 | h.get_reference(); |
| 1158 | handles.push_back(&h); |
| 1159 | } |
| 1160 | } |
| 1161 | |
| 1162 | if (unprotected_list_front_ != nullptr) { |
| 1163 | DCHECK(unprotected_list_front_->unprotected_tombstone_list_hook_.is_linked()); |
| 1164 | // From 'unprotected_list_front_' to the end of 'unprotected_tombstone_list_' are all |
| 1165 | // UNPROTECTED entries, collecting them all. |
| 1166 | auto iter = unprotected_tombstone_list_.iterator_to(*unprotected_list_front_); |
| 1167 | while (iter != unprotected_tombstone_list_.end()) { |
| 1168 | iter->get_reference(); |
| 1169 | handles.push_back(&*iter); |
| 1170 | ++iter; |
| 1171 | } |
| 1172 | } |
| 1173 | |
| 1174 | return handles; |
| 1175 | } |
| 1176 | |
| 1177 | } // end anonymous namespace |
| 1178 |
nothing calls this directly
no test coverage detected