MCPcopy Index your code
hub / github.com/upper/db / NewCache

Function NewCache

internal/cache/cache.go:62–70  ·  view source on GitHub ↗

NewCache initializes a new caching space with default settings.

()

Source from the content-addressed store, hash-verified

60
61// NewCache initializes a new caching space with default settings.
62func NewCache() *Cache {
63 c, err := NewCacheWithCapacity(defaultCapacity)
64
65 if err != nil {
66 panic(err.Error()) // Should never happen as we're not providing a negative defaultCapacity.
67 }
68
69 return c
70}
71
72func (c *Cache) init() {
73 c.items = make(map[uint64]*list.Element)

Callers 15

NewTxFunction · 0.92
NewSessionFunction · 0.92
default.goFile · 0.92
builder_test.goFile · 0.92
template.goFile · 0.92
template.goFile · 0.92
template.goFile · 0.92
template.goFile · 0.92
template.goFile · 0.92
template.goFile · 0.92
TestCacheFunction · 0.85
BenchmarkNewCacheFunction · 0.85

Calls 2

NewCacheWithCapacityFunction · 0.85
ErrorMethod · 0.65

Tested by 7

TestCacheFunction · 0.68
BenchmarkNewCacheFunction · 0.68
BenchmarkWriteSameValueFunction · 0.68
BenchmarkWriteNewValueFunction · 0.68