diff options
author | EuAndreh <eu@euandre.org> | 2024-12-30 23:08:43 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-12-30 23:08:43 -0300 |
commit | e90982cb2ef01fd43ae93c729a5a5828ca345c44 (patch) | |
tree | 0910a4935340e3355e1c8277650cd0d1f4ecbbe9 | |
parent | src/dedo.go: Remove Bucket.FillPercent option (diff) | |
download | dedo-e90982cb2ef01fd43ae93c729a5a5828ca345c44.tar.gz dedo-e90982cb2ef01fd43ae93c729a5a5828ca345c44.tar.xz |
src/dedo.go: Remove Options.InitialMmapSize option
-rw-r--r-- | src/dedo.go | 11 | ||||
-rw-r--r-- | tests/dedo.go | 3 |
2 files changed, 2 insertions, 12 deletions
diff --git a/src/dedo.go b/src/dedo.go index 437680b..b81b55b 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -176,15 +176,6 @@ type panicked struct { // Options represents the options that can be set when opening a database. type Options struct { - // InitialMmapSize is the initial mmap size of the database - // in bytes. Read transactions won't block write transaction - // if the InitialMmapSize is large enough to hold database mmap - // size. (See DB.Begin for more information) - // - // If <=0, the initial map size is 0. - // If initialMmapSize is smaller than the previous database size, - // it takes no effect. - InitialMmapSize int } // Stats represents statistics about the database. @@ -1882,7 +1873,7 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) { } // Memory map the data file. - if err := db.mmap(options.InitialMmapSize); err != nil { + if err := db.mmap(0); err != nil { _ = db.close() return nil, err } diff --git a/tests/dedo.go b/tests/dedo.go index c614cb9..bb1d001 100644 --- a/tests/dedo.go +++ b/tests/dedo.go @@ -3182,10 +3182,9 @@ func TestDB_Open_InitialMmapSize(t *testing.T) { path := tempfile() defer os.Remove(path) - initMmapSize := 1 << 31 // 2GB testWriteSize := 1 << 27 // 134MB - db, err := Open(path, 0666, &Options{InitialMmapSize: initMmapSize}) + db, err := Open(path, 0666, &Options{}) if err != nil { t.Fatal(err) } |