MCPcopy Index your code
hub / github.com/perkeep/perkeep / New

Function New

internal/lru/cache.go:43–49  ·  view source on GitHub ↗

New returns a new cache with the provided maximum items. A maxEntries of 0 means no limit.

(maxEntries int)

Source from the content-addressed store, hash-verified

41// New returns a new cache with the provided maximum items.
42// A maxEntries of 0 means no limit.
43func New(maxEntries int) *Cache {
44 return &Cache{
45 maxEntries: maxEntries,
46 ll: list.New(),
47 cache: make(map[string]*list.Element),
48 }
49}
50
51// NewUnlocked is like New but returns a Cache that is not safe
52// for concurrent access.

Callers 6

NewCacheFunction · 0.92
NewThumbMetaFunction · 0.92
newCamliFileSystemFunction · 0.92
NewUnlockedFunction · 0.70
TestLRUFunction · 0.70
TestRemoveOldestFunction · 0.70

Calls

no outgoing calls

Tested by 2

TestLRUFunction · 0.56
TestRemoveOldestFunction · 0.56