MCPcopy Create free account
hub / github.com/cortexproject/cortex / sizeOf

Function sizeOf

pkg/chunk/cache/fifo_cache.go:297–303  ·  view source on GitHub ↗
(item *cacheEntry)

Source from the content-addressed store, hash-verified

295}
296
297func sizeOf(item *cacheEntry) uint64 {
298 return uint64(int(unsafe.Sizeof(*item)) + // size of cacheEntry
299 len(item.key) + // size of key
300 cap(item.value) + // size of value
301 elementSize + // size of the element in linked list
302 elementPrtSize) // size of the pointer to an element in the map
303}

Callers 3

putMethod · 0.85
TestFifoCacheEvictionFunction · 0.85
TestFifoCacheExpiryFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestFifoCacheEvictionFunction · 0.68
TestFifoCacheExpiryFunction · 0.68