aboutsummaryrefslogtreecommitdiff
path: root/db.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2015-02-16 16:45:58 -0700
committerBen Johnson <benbjohnson@yahoo.com>2015-02-16 16:45:58 -0700
commitc8ecb61df213b389af9da90983fc8bf5133e1007 (patch)
treeed4d491b6bfc44df308777f2ce1c2580caf2d543 /db.go
parentREADME (diff)
parentFix large mmap resize. (diff)
downloaddedo-c8ecb61df213b389af9da90983fc8bf5133e1007.tar.gz
dedo-c8ecb61df213b389af9da90983fc8bf5133e1007.tar.xz
Merge pull request #304 from benbjohnson/fix-large-resize
Fix large mmap resize
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.