68 CCache(int64_t cache_size, int64_t obj_size, int64_t num_entries)
71 if (cache_size==0 || obj_size==0 || num_entries==0)
73 SG_INFO(
"doing without cache.\n");
99 for (i=0; i<num_entries; i++)
171 bool found_free_line=
false;
180 found_free_line=
true;
189 found_free_line=
true;
201 found_free_line=
true;
212 found_free_line=
true;
245 inline 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,...)
#define SG_MALLOC(type, len)