33 #include "params/SecondChanceRP.hh"
42 const std::shared_ptr<SecondChanceReplData>& replacement_data)
const
48 replacement_data->hasSecondChance =
false;
53 const std::shared_ptr<ReplacementData>& replacement_data)
const
58 std::static_pointer_cast<SecondChanceReplData>(
59 replacement_data)->hasSecondChance =
false;
64 replacement_data)
const
69 std::static_pointer_cast<SecondChanceReplData>(
70 replacement_data)->hasSecondChance =
true;
75 replacement_data)
const
80 std::static_pointer_cast<SecondChanceReplData>(
81 replacement_data)->hasSecondChance =
false;
88 assert(candidates.size() > 0);
91 for (
const auto& candidate : candidates) {
93 std::shared_ptr<SecondChanceReplData> candidate_replacement_data =
94 std::static_pointer_cast<SecondChanceReplData>(
95 candidate->replacementData);
98 if ((candidate_replacement_data->tickInserted ==
Tick(0)) &&
99 !candidate_replacement_data->hasSecondChance) {
106 bool search_victim =
true;
107 while (search_victim) {
112 std::shared_ptr<SecondChanceReplData> victim_replacement_data =
113 std::static_pointer_cast<SecondChanceReplData>(
117 if (victim_replacement_data->hasSecondChance) {
121 search_victim =
false;
128 std::shared_ptr<ReplacementData>
135 SecondChanceRPParams::create()