free recursively frees all pages in the bucket.
()
| 902 | |
| 903 | // free recursively frees all pages in the bucket. |
| 904 | func (b *Bucket) free() { |
| 905 | if b.RootPage() == 0 { |
| 906 | return |
| 907 | } |
| 908 | |
| 909 | var tx = b.tx |
| 910 | b.forEachPageNode(func(p *common.Page, n *node, _ int) { |
| 911 | if p != nil { |
| 912 | tx.db.freelist.Free(tx.meta.Txid(), p) |
| 913 | } else { |
| 914 | n.free() |
| 915 | } |
| 916 | }) |
| 917 | b.SetRootPage(0) |
| 918 | } |
| 919 | |
| 920 | // dereference removes all references to the old mmap. |
| 921 | func (b *Bucket) dereference() { |
no test coverage detected