Struct git_pack::cache::lru::MemoryCappedHashmap
source · pub struct MemoryCappedHashmap { /* private fields */ }
Available on crate feature
pack-cache-lru-dynamic
and (crate features pack-cache-lru-dynamic
or pack-cache-lru-static
) only.Expand description
An LRU cache with hash map backing and an eviction rule based on the memory usage for object data in bytes.
Implementations§
source§impl MemoryCappedHashmap
impl MemoryCappedHashmap
sourcepub fn new(memory_cap_in_bytes: usize) -> MemoryCappedHashmap
pub fn new(memory_cap_in_bytes: usize) -> MemoryCappedHashmap
Return a new instance which evicts least recently used items if it uses more than memory_cap_in_bytes
object data.