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

Method free

bucket.go:904–918  ·  view source on GitHub ↗

free recursively frees all pages in the bucket.

()

Source from the content-addressed store, hash-verified

902
903// free recursively frees all pages in the bucket.
904func (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.
921func (b *Bucket) dereference() {

Callers 2

DeleteBucketMethod · 0.45
spillMethod · 0.45

Calls 5

forEachPageNodeMethod · 0.95
RootPageMethod · 0.80
TxidMethod · 0.80
SetRootPageMethod · 0.80
FreeMethod · 0.65

Tested by

no test coverage detected