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

Function pagePrintFreelist

cmd/bbolt/command/command_page.go:212–229  ·  view source on GitHub ↗

pagePrintFreelist prints the data for a freelist page.

(w io.Writer, buf []byte)

Source from the content-addressed store, hash-verified

210
211// pagePrintFreelist prints the data for a freelist page.
212func pagePrintFreelist(w io.Writer, buf []byte) error {
213 p := common.LoadPage(buf)
214
215 // print number of items.
216 _, cnt := p.FreelistPageCount()
217 fmt.Fprintf(w, "Item Count: %d\n", cnt)
218 fmt.Fprintf(w, "Overflow: %d\n", p.Overflow())
219
220 fmt.Fprintf(w, "\n")
221
222 // print each page in the freelist.
223 ids := p.FreelistPageIds()
224 for _, ids := range ids {
225 fmt.Fprintf(w, "%d\n", ids)
226 }
227 fmt.Fprintf(w, "\n")
228 return nil
229}

Callers 1

printPageFunction · 0.85

Calls 4

LoadPageFunction · 0.92
FreelistPageCountMethod · 0.80
OverflowMethod · 0.80
FreelistPageIdsMethod · 0.80

Tested by

no test coverage detected