MCPcopy
hub / github.com/etcd-io/bbolt / UsedSpaceInPage

Function UsedSpaceInPage

internal/common/inode.go:107–115  ·  view source on GitHub ↗
(inodes Inodes, p *Page)

Source from the content-addressed store, hash-verified

105}
106
107func UsedSpaceInPage(inodes Inodes, p *Page) uint32 {
108 off := unsafe.Sizeof(*p) + p.PageElementSize()*uintptr(len(inodes))
109 for _, item := range inodes {
110 sz := len(item.Key()) + len(item.Value())
111 off += uintptr(sz)
112 }
113
114 return uint32(off)
115}

Callers 1

ClearPageElementsFunction · 0.92

Calls 3

PageElementSizeMethod · 0.80
KeyMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected