SIZE:
map size == lru size + 1
Map:
lru
index to last recently used item or None
buckets: Option<NonZero<usize>>[size]
indexes into entries
entries: Entry[size]
0th element is unused.
preallocated block of where entries are actually stored
Entry<K, V>:
K(read only),
V,
collision_next
pointer to singly linked list of hashed-collision next elements
lru_prev
previous of linked list of LRU order or None for first
-------
| MAP |
-------
lru >>| collisions >>
|
|
Hash | |-------->|
--------- |
0 | ENTRY | > ENTRY --->|
--------- |
|
|<---------------<|<-----|
--------- | |
1 | ENTRY | > ENTRY > ENTRY--->|
--------- |
|
--------- |
2 | ENTRY |<----|
---------
|-------->|
|
--------- |
3 | ENTRY |<----|
---------