aboutsummaryrefslogtreecommitdiff
path: root/db.go
diff options
context:
space:
mode:
Diffstat (limited to 'db.go')
-rw-r--r--db.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/db.go b/db.go
index 773620d..4775850 100644
--- a/db.go
+++ b/db.go
@@ -231,9 +231,9 @@ func (db *DB) mmapSize(size int) (int, error) {
}
// If larger than 1GB then grow by 1GB at a time.
- sz := int64(size) + int64(maxMmapStep)
+ sz := int64(size)
if remainder := sz % int64(maxMmapStep); remainder > 0 {
- sz -= remainder
+ sz += int64(maxMmapStep) - remainder
}
// Ensure that the mmap size is a multiple of the page size.