Electroneum
lruhash_entry Struct Reference

#include <lruhash.h>

Collaboration diagram for lruhash_entry:

Public Attributes

lock_rw_type lock
 
struct lruhash_entryoverflow_next
 
struct lruhash_entrylru_next
 
struct lruhash_entrylru_prev
 
hashvalue_type hash
 
void * key
 
void * data
 

Detailed Description

An entry into the hash table. To change overflow_next you need to hold the bin lock. To change the lru items you need to hold the hashtable lock. This structure is designed as part of key struct. And key pointer helps to get the surrounding structure. Data should be allocated on its own.

Definition at line 203 of file lruhash.h.

Member Data Documentation

◆ data

void* lruhash_entry::data

data

Definition at line 222 of file lruhash.h.

◆ hash

hashvalue_type lruhash_entry::hash

hash value of the key. It may not change, until entry deleted.

Definition at line 218 of file lruhash.h.

◆ key

void* lruhash_entry::key

key

Definition at line 220 of file lruhash.h.

◆ lock

lock_rw_type lruhash_entry::lock

rwlock for access to the contents of the entry Note that it does not cover the lru_ and overflow_ ptrs. Even with a writelock, you cannot change hash and key. You need to delete it to change hash or key.

Definition at line 210 of file lruhash.h.

◆ lru_next

struct lruhash_entry* lruhash_entry::lru_next

next entry in lru chain. covered by hashlock.

Definition at line 214 of file lruhash.h.

◆ lru_prev

struct lruhash_entry* lruhash_entry::lru_prev

prev entry in lru chain. covered by hashlock.

Definition at line 216 of file lruhash.h.

◆ overflow_next

struct lruhash_entry* lruhash_entry::overflow_next

next entry in overflow chain. Covered by hashlock and binlock.

Definition at line 212 of file lruhash.h.


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