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

Method FreelistPageIds

internal/common/page.go:152–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150}
151
152func (p *Page) FreelistPageIds() []Pgid {
153 if !p.IsFreelistPage() {
154 panic(fmt.Sprintf("assertion failed: can't get freelist page IDs from a non-freelist page: %2x", p.flags))
155 }
156
157 idx, count := p.FreelistPageCount()
158
159 if count == 0 {
160 return nil
161 }
162
163 data := UnsafeIndex(unsafe.Pointer(p), unsafe.Sizeof(*p), pgidSize, idx)
164 ids := unsafe.Slice((*Pgid)(data), count)
165
166 return ids
167}
168
169// dump writes n bytes of the page to STDERR as hex output.
170func (p *Page) hexdump(n int) {

Callers 3

ReadMethod · 0.80
pagePrintFreelistFunction · 0.80
readFreelistPageIdsFunction · 0.80

Calls 3

IsFreelistPageMethod · 0.95
FreelistPageCountMethod · 0.95
UnsafeIndexFunction · 0.85

Tested by 1

readFreelistPageIdsFunction · 0.64