From 0477c1e0cec8f8f1fa0b71f2c04bc988f43fd01a Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Thu, 27 Feb 2014 14:33:31 -0700 Subject: 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. --- db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db.go') 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 { -- cgit v1.2.3