libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
Loading...
Searching...
No Matches
CacheEntry Struct Reference

Single hash entry in the in-memory cache. More...

#include <aaruformat/lru.h>

Data Fields

char * key
 Null-terminated key string (unique within the cache). May encode numeric keys.
void * value
 Opaque value pointer associated with key (not freed automatically on eviction/clear).
UT_hash_handle hh
 uthash handle linking this entry into the hash table (must remain last or per uthash docs).

Detailed Description

Single hash entry in the in-memory cache.

This structure is managed by uthash (open addressing with chaining semantics provided by macros). It represents one key/value association tracked by the cache. The cache implementation supports both string keys (null-terminated) and 64-bit numeric keys; numeric keys are stored by casting to a temporary string buffer upstream (see implementation). Callers do not allocate or free individual entries directly; use the cache API helpers.

Lifetime & ownership:

  • key points either to a heap-allocated C string owned by the cache or to a short-lived buffer duplicated internally; callers must not free it after insertion.
  • value is an opaque pointer supplied by caller; the cache does not take ownership of the pointee (caller remains responsible for the underlying object unless documented otherwise).

Definition at line 26 of file lru.h.

Field Documentation

◆ hh

UT_hash_handle CacheEntry::hh

uthash handle linking this entry into the hash table (must remain last or per uthash docs).

Definition at line 30 of file lru.h.

Referenced by add_to_cache(), and find_in_cache().

◆ key

char* CacheEntry::key

Null-terminated key string (unique within the cache). May encode numeric keys.

Definition at line 28 of file lru.h.

Referenced by add_to_cache(), add_to_cache_uint64(), find_in_cache(), and find_in_cache_uint64().

◆ value

void* CacheEntry::value

Opaque value pointer associated with key (not freed automatically on eviction/clear).

Definition at line 29 of file lru.h.

Referenced by add_to_cache(), add_to_cache_uint64(), and find_in_cache().


The documentation for this struct was generated from the following file:
  • include/aaruformat/lru.h