Skip to content

Commit

Permalink
Avoid allocate a hole page, when the node size equals to pageSize
Browse files Browse the repository at this point in the history
  • Loading branch information
buptmiao committed Sep 24, 2016
1 parent fff57c1 commit ef23622
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ef23622

Please sign in to comment.