Skip to content

Commit

Permalink
Merge pull request boltdb#24 from heyitsanthony/node-gap
Browse files Browse the repository at this point in the history
Avoid allocate a hole page, when the node size equals to pageSize
  • Loading branch information
Anthony Romano authored Aug 11, 2017
2 parents 2db8c23 + ef23622 commit dd1d5a7
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 dd1d5a7

Please sign in to comment.