MCPcopy
hub / github.com/grpc/grpc-go / newLRU

Function newLRU

balancer/rls/cache.go:127–132  ·  view source on GitHub ↗

newLRU creates a new cache with a least recently used eviction policy.

()

Source from the content-addressed store, hash-verified

125
126// newLRU creates a new cache with a least recently used eviction policy.
127func newLRU() *lru {
128 return &lru{
129 ll: list.New(),
130 m: make(map[cacheKey]*list.Element),
131 }
132}
133
134func (l *lru) addEntry(key cacheKey) {
135 e := l.ll.PushBack(key)

Callers 2

newDataCacheFunction · 0.85

Calls

no outgoing calls

Tested by 1