Loading...
Searching...
No Matches
CacheHeader Struct Reference

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 (policy: enforce/ignore depends on implementation).
struct CacheEntry * | cache
| Hash root (uthash). NULL when empty.
void(* | free_func )(void *)
| Optional callback to free cached values. NULL if values don't need freeing.

## Detailed Description

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. Insert helpers are expected to evict (or refuse) when the limit is exceeded (strategy defined in implementation; current behavior may be simple non-evicting if not yet implemented as a true LRU). The cache pointer holds the uthash root (NULL when empty).

Fields:

- max_items: Maximum number of entries allowed; 0 means "no explicit limit" if accepted by implementation.
- cache: uthash root pointer; NULL when the cache is empty.

Definition at line 45 of file lru.h.

## Field Documentation

## cache

struct CacheEntry* CacheHeader::cache

Hash root (uthash). NULL when empty.

Definition at line 48 of file lru.h.

Referenced by aaruf_create(), aaruf_open(), add_to_cache(), find_in_cache(), and free_cache().

## free_func

void(* CacheHeader::free_func) (void *)

Optional callback to free cached values. NULL if values don't need freeing.

Definition at line 49 of file lru.h.

Referenced by aaruf_open(), add_to_cache(), and free_cache().

## max_items

uint64_t CacheHeader::max_items

Hard limit for number of entries (policy: enforce/ignore depends on implementation).

Definition at line 47 of file lru.h.

Referenced by aaruf_create(), aaruf_open(), and add_to_cache().

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

- include/aaruformat/lru.h