34 #include "params/MRURP.hh"
41 namespace replacement_policy
53 std::static_pointer_cast<MRUReplData>(
54 replacement_data)->lastTouchTick =
Tick(0);
58 MRU::touch(
const std::shared_ptr<ReplacementData>& replacement_data)
const
61 std::static_pointer_cast<MRUReplData>(
62 replacement_data)->lastTouchTick =
curTick();
66 MRU::reset(
const std::shared_ptr<ReplacementData>& replacement_data)
const
69 std::static_pointer_cast<MRUReplData>(
70 replacement_data)->lastTouchTick =
curTick();
77 assert(candidates.size() > 0);
81 for (
const auto& candidate : candidates) {
82 std::shared_ptr<MRUReplData> candidate_replacement_data =
83 std::static_pointer_cast<MRUReplData>(candidate->replacementData);
86 if (candidate_replacement_data->lastTouchTick == 0) {
89 }
else if (candidate_replacement_data->lastTouchTick >
90 std::static_pointer_cast<MRUReplData>(
99 std::shared_ptr<ReplacementData>
102 return std::shared_ptr<ReplacementData>(
new MRUReplData());