Cache structure. More...
#include <cache.h>
Data Fields | |
int | max |
For how many entries is space allocated? | |
int | used |
How many entries are used. | |
int | lru |
Which entry was the last accessed. | |
struct cache_entry_t * | entries [CACHE_DEFAULT+1] |
Cache entries, NULL terminated. |
Cache structure.
The more active an entry is, the more at the start of the array.
If a struct
cache_t is allocated, its .max member should be set to the default CACHE_DEFAULT value.
For a struct
cache_t* the function cch__new_cache() must be used.
Definition at line 52 of file cache.h.
struct cache_entry_t* cache_t::entries[CACHE_DEFAULT+1] [read] |
Cache entries, NULL
terminated.
Definition at line 81 of file cache.h.
Referenced by _st___string_from_bits(), cch__add(), cch__find(), cch__hash_add(), cch__hash_find(), cch__set_active(), cch__set_by_id(), cm___absolute_path(), hlp___do_convert(), and ops__build_path().
int cache_t::lru |
Which entry was the last accessed.
If the array of entries looked like this, with B
accessed after C
after D:
After setting a new entry A
it looks like that:
*
Definition at line 78 of file cache.h.
Referenced by _st___string_from_bits(), cch__add(), cch__hash_add(), cch__set_active(), cm___absolute_path(), hlp___do_convert(), and ops__build_path().
int cache_t::max |
For how many entries is space allocated?
Definition at line 54 of file cache.h.
Referenced by cch__add(), cch__set_active(), hlp__get_grname(), hlp__get_uname(), and ops__build_path().
int cache_t::used |
How many entries are used.
Definition at line 56 of file cache.h.
Referenced by cch__add(), and cch__find().