47 explicit AdaptiveLru(
const std::string &name,
size_t max_size);
50 INLINE
size_t get_total_size()
const;
51 INLINE
size_t get_max_size()
const;
52 INLINE
void set_max_size(
size_t max_size);
53 size_t count_active_size()
const;
55 INLINE
void consider_evict();
56 INLINE
void evict_to(
size_t target_size);
59 INLINE
bool validate();
61 void output(std::ostream &out)
const;
62 void write(std::ostream &out,
int indent_level)
const;
67 INLINE
void set_weight(PN_stdfloat weight);
68 INLINE PN_stdfloat get_weight()
const;
70 INLINE
void set_max_updates_per_frame(
int max_updates_per_frame);
71 INLINE
int get_max_updates_per_frame()
const;
75 enum LruPagePriority {
80 LPP_Intermediate = 30,
82 LPP_TotalPriorities = 50,
85 INLINE PN_stdfloat calculate_exponential_moving_average(PN_stdfloat value, PN_stdfloat average)
const;
87 void do_partial_lru_update(
int num_updates);
94 void do_evict_to(
size_t target_size,
bool hard_evict);
102 unsigned int _current_frame_identifier;
104 int _max_updates_per_frame;
One atomic piece that may be managed by a AdaptiveLru chain.