Avoid allocate a hole page, when the node size equals to pageSize

This commit is contained in:
miao 2016-09-25 00:55:55 +08:00
parent fff57c100f
commit ef236228fa

View File

@ -365,7 +365,7 @@ func (n *node) spill() error {
}
// 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 {
return err
}