regfi
Data Structures | Functions
lru_cache.h File Reference

A data structure which approximates a least recently used (LRU) cache. More...

Include dependency graph for lru_cache.h:

Go to the source code of this file.

Data Structures

struct  lru_cache_element
 
struct  lru_cache
 XXX: document this. More...
 

Functions

lru_cachelru_cache_create (uint32_t max_keys, uint32_t secret)
 XXX: finish documenting.
 
lru_cachelru_cache_create_ctx (void *talloc_ctx, uint32_t max_keys, uint32_t secret, bool talloc_data)
 XXX: finish documenting.
 
void lru_cache_destroy (lru_cache *ht)
 XXX: finish documenting.
 
bool lru_cache_update (lru_cache *ht, const void *index, uint32_t index_len, void *data)
 XXX: finish documenting.
 
void * lru_cache_find (lru_cache *ht, const void *index, uint32_t index_len)
 XXX: finish documenting. More...
 
bool lru_cache_remove (lru_cache *ht, const void *index, uint32_t index_len)
 XXX: finish documenting. More...
 

Detailed Description

A data structure which approximates a least recently used (LRU) cache.

Implemented as a basic randomized hash table.

Function Documentation

◆ lru_cache_find()

void* lru_cache_find ( lru_cache ht,
const void *  index,
uint32_t  index_len 
)

XXX: finish documenting.

Returns
A pointer to data previously stored at index. If no data was found at index, NULL is returned.

◆ lru_cache_remove()

bool lru_cache_remove ( lru_cache ht,
const void *  index,
uint32_t  index_len 
)

XXX: finish documenting.

Removes entry from table at index.

Returns
A pointer to data that was there previously or NULL if no entry is at index.