diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2015-02-16 15:22:12 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2015-02-16 15:23:48 -0700 |
commit | e7f5c931e2e0471a72d88fda6fff738626dbb7d9 (patch) | |
tree | ed4d491b6bfc44df308777f2ce1c2580caf2d543 /db.go | |
parent | README (diff) | |
download | dedo-e7f5c931e2e0471a72d88fda6fff738626dbb7d9.tar.gz dedo-e7f5c931e2e0471a72d88fda6fff738626dbb7d9.tar.xz |
Fix large mmap resize.
This commit fixes an issue where large databases were being resized to
larger sizes on every open.
Diffstat (limited to 'db.go')
-rw-r--r-- | db.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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. |