pagePrintFreelist prints the data for a freelist page.
(w io.Writer, buf []byte)
| 210 | |
| 211 | // pagePrintFreelist prints the data for a freelist page. |
| 212 | func 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 | } |
no test coverage detected