mirror of https://github.com/etcd-io/bbolt.git
Avoid allocate a hole page, when the node size equals to pageSize
parent
fff57c100f
commit
ef236228fa
2
node.go
2
node.go
|
@ -365,7 +365,7 @@ func (n *node) spill() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate contiguous space for the node.
|
// Allocate contiguous space for the node.
|
||||||
p, err := tx.allocate((node.size() / tx.db.pageSize) + 1)
|
p, err := tx.allocate((node.size() + tx.db.pageSize - 1) / tx.db.pageSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue