35 #include "params/RandomRP.hh" 48 replacement_data)->valid =
false;
61 replacement_data)->valid =
true;
68 assert(candidates.size() > 0);
72 candidates.size() - 1)];
76 for (
const auto& candidate : candidates) {
77 if (!std::static_pointer_cast<RandomReplData>(
78 candidate->replacementData)->valid) {
87 std::shared_ptr<ReplacementData>
94 RandomRPParams::create()
MRU-specific implementation of replacement data.
BaseReplacementPolicyParams Params
Convenience typedef.
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim at random.
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
A common base class of cache replacement policy objects.
std::enable_if< std::is_integral< T >::value, T >::type random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
Copyright (c) 2018 Inria All rights reserved.
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const override
Invalidate replacement data to set it as the next probable victim.
RandomRP(const Params *p)
Construct and initiliaze this replacement policy.
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.