| 100 | } |
| 101 | |
| 102 | void ClearExcess() { |
| 103 | this->CheckConsistent(); |
| 104 | // clear half of the entries to prevent repeatingly clearing cache. |
| 105 | std::size_t half_size = max_size_ / 2; |
| 106 | while (queue_.size() >= half_size && !queue_.empty()) { |
| 107 | auto p_fmat = queue_.front(); |
| 108 | queue_.pop(); |
| 109 | container_.erase(p_fmat); |
| 110 | } |
| 111 | this->CheckConsistent(); |
| 112 | } |
| 113 | |
| 114 | public: |
| 115 | /** |
no test coverage detected