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

pull/24/head
miao 2016-09-25 00:55:55 +08:00
parent fff57c100f
commit ef236228fa
1 changed files with 1 additions and 1 deletions

View File

@ -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
} }