aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-02-27 14:33:31 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-02-27 14:33:31 -0700
commit0477c1e0cec8f8f1fa0b71f2c04bc988f43fd01a (patch)
tree3dd21d3df98e00626dec99ad09d584a194fba7e4
parentAdd bucket reclamation. (diff)
downloaddedo-0477c1e0cec8f8f1fa0b71f2c04bc988f43fd01a.tar.gz
dedo-0477c1e0cec8f8f1fa0b71f2c04bc988f43fd01a.tar.xz
Fix the mmap resize to use the correct size.
Fixes #54. Previously the DB was calculating a minimum mmap size but using the wrong variable after it calculated the size. This commit changes the DB to use the correct variable.
-rw-r--r--db.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/db.go b/db.go
index 5cf1c6f..22da2e6 100644
--- a/db.go
+++ b/db.go
@@ -146,7 +146,7 @@ func (db *DB) mmap(minsz int) error {
if size < minsz {
size = minsz
}
- size = db.mmapSize(minsz)
+ size = db.mmapSize(size)
// Memory-map the data file as a byte slice.
if db.data, err = db.syscall.Mmap(int(db.file.Fd()), 0, size, syscall.PROT_READ, syscall.MAP_SHARED); err != nil {