Loading...
Searching...
No Matches
lru_kv_pair_t Struct Reference

Single key/value slot with access tracking for the static LRU hash map. More...

`#include <aaruformat/static_lru_hash_map.h>`

## Data Fields

uint64_t | key
| Stored key (64-bit). 0 indicates an empty slot.
uint64_t | value
| Associated value payload (64-bit).
uint8_t | access_count
| Access frequency counter (0-255, saturates at 255).
uint8_t | _padding [7]
| Padding for 8-byte alignment (24 bytes total per entry).

## Detailed Description

Single key/value slot with access tracking for the static LRU hash map.

Extends the basic kv_pair_t with an access counter to enable LFU-based eviction. The access_count saturates at 255 and is periodically aged (halved) to prevent stale "hot" entries from permanently occupying the cache.

An empty slot is represented by key == 0. This means 0 cannot be used as a valid key.

Definition at line 71 of file static_lru_hash_map.h.

## Field Documentation

## _padding

uint8_t lru_kv_pair_t::_padding[7]

Padding for 8-byte alignment (24 bytes total per entry).

Definition at line 76 of file static_lru_hash_map.h.

## access_count

uint8_t lru_kv_pair_t::access_count

Access frequency counter (0-255, saturates at 255).

Definition at line 75 of file static_lru_hash_map.h.

Referenced by age_access_counts(), evict_lru_entries(), static_lru_insert_map(), and static_lru_lookup_map().

## key

uint64_t lru_kv_pair_t::key

Stored key (64-bit). 0 indicates an empty slot.

Definition at line 73 of file static_lru_hash_map.h.

Referenced by age_access_counts(), evict_lru_entries(), rehash_in_place(), static_lru_contains_key(), static_lru_insert_map(), and static_lru_lookup_map().

## value

uint64_t lru_kv_pair_t::value

Associated value payload (64-bit).

Definition at line 74 of file static_lru_hash_map.h.

Referenced by evict_lru_entries(), static_lru_insert_map(), and static_lru_lookup_map().

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

- include/aaruformat/static_lru_hash_map.h