LongLruMemoryCache

open class LongLruMemoryCache<V : Any>(val capacity: Long, lowWater: Long = (capacity * 0.75).toLong())

LRU memory cache keyed by primitive Long, eliminating per-lookup boxing overhead that occurs with LruMemoryCache backed by a generic HashMap.

Uses open addressing with linear probing and tombstone compaction on eviction, plus an intrusive doubly-linked list across Entry objects for O(1) LRU eviction (head = MRU, tail = LRU). The slot table only resolves keys; eviction order is independent of slot layout and survives rehashes without bookkeeping.

Constructors

Link copied to clipboard
constructor(capacity: Long, lowWater: Long = (capacity * 0.75).toLong())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun clear()
Link copied to clipboard
open fun containsKey(key: Long): Boolean
Link copied to clipboard
open operator fun get(key: Long): V?
Link copied to clipboard
open fun put(key: Long, value: V, size: Int): V?
Link copied to clipboard
open fun remove(key: Long): V?