libfoedus-core
FOEDUS Core Library
foedus::cache::CacheRefCount Struct Referencefinal

A loosely maintained reference count for CLOCK algorithm. More...

Detailed Description

A loosely maintained reference count for CLOCK algorithm.

Definition at line 163 of file cache_hashtable.hpp.

#include <cache_hashtable.hpp>

Public Member Functions

void increment () __attribute__((always_inline))
 
bool decrement (uint16_t subtract) __attribute__((always_inline))
 returns whether the counter is still non-zero More...
 

Public Attributes

uint16_t count_
 

Member Function Documentation

bool foedus::cache::CacheRefCount::decrement ( uint16_t  subtract)
inline

returns whether the counter is still non-zero

Definition at line 172 of file cache_hashtable.hpp.

Referenced by foedus::cache::CacheHashtable::evict_main_loop(), and foedus::cache::CacheHashtable::evict_overflow_loop().

172  {
173  if (count_ >= subtract) {
174  count_ -= subtract;
175  } else {
176  count_ = 0;
177  }
178  return (count_ > 0);
179  }

Here is the caller graph for this function:

void foedus::cache::CacheRefCount::increment ( )
inline

Definition at line 166 of file cache_hashtable.hpp.

References count_.

Referenced by foedus::cache::CacheHashtable::find(), and foedus::cache::CacheHashtable::find_batch().

166  {
167  if (count_ < 0xFFFFU) {
168  ++count_;
169  }
170  }

Here is the caller graph for this function:

Member Data Documentation

uint16_t foedus::cache::CacheRefCount::count_

The documentation for this struct was generated from the following file: