70 CCache(int64_t cache_size, int64_t obj_size, int64_t num_entries)
73 if (cache_size==0 || obj_size==0 || num_entries==0)
75 SG_INFO(
"doing without cache.\n")
101 for (i=0; i<num_entries; i++)
174 bool found_free_line=
false;
183 found_free_line=
true;
192 found_free_line=
true;
204 found_free_line=
true;
215 found_free_line=
true;
248 virtual const char*
get_name()
const {
return "Cache"; }
virtual const char * get_name() const
CCache(int64_t cache_size, int64_t obj_size, int64_t num_entries)
void unlock_entry(int64_t number)
T * set_entry(int64_t number)
bool is_cached(int64_t number)
Class SGObject is the base class of all shogun objects.
T * lock_entry(int64_t number)
static T min(T a, T b)
return the minimum of two integers
Template class Cache implements a simple cache.
#define SG_UNSTABLE(func,...)