aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dedo.go11
-rw-r--r--tests/dedo.go3
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)
}