| 150 | } |
| 151 | |
| 152 | func (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. |
| 170 | func (p *Page) hexdump(n int) { |