|
libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
|
Cache top-level descriptor encapsulating the hash table root and capacity limit. More...
#include <aaruformat/lru.h>
Data Fields | |
| uint64_t | max_items |
| Hard limit for number of entries. | |
| struct CacheEntry * | cache |
| Hash root (uthash). NULL when empty. | |
| void(* | free_func )(void *) |
| Optional callback to free cached values. NULL if not needed. | |
Cache top-level descriptor encapsulating the hash table root and capacity limit.
The cache enforces an upper bound (max_items) on the number of tracked entries. On insert, the oldest entry is evicted when the limit is reached (LRU via uthash insertion order).
Fields:
| struct CacheEntry* CacheHeader::cache |
Hash root (uthash). NULL when empty.
Definition at line 44 of file lru.h.
Referenced by aaruf_create(), aaruf_open(), add_to_cache_uint64(), find_in_cache_uint64(), and free_cache().
| void(* CacheHeader::free_func) (void *) |
Optional callback to free cached values. NULL if not needed.
Definition at line 45 of file lru.h.
Referenced by aaruf_open(), add_to_cache_uint64(), and free_cache().
| uint64_t CacheHeader::max_items |
Hard limit for number of entries.
Definition at line 43 of file lru.h.
Referenced by aaruf_create(), aaruf_open(), and add_to_cache_uint64().