Skip to content

Commit 682819c

Browse files
authored
Merge pull request #990 from ahrtr/20250615_maxMapSize_1.4
[release-1.4] Fix maxMapSize typo in aix, android and solaris
2 parents 2855a18 + 2d2c8e4 commit 682819c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

bolt_aix.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"unsafe"
1010

1111
"golang.org/x/sys/unix"
12+
13+
"go.etcd.io/bbolt/internal/common"
1214
)
1315

1416
// flock acquires an advisory lock on a file descriptor.
@@ -69,7 +71,7 @@ func mmap(db *DB, sz int) error {
6971

7072
// Save the original byte slice and convert to a byte array pointer.
7173
db.dataref = b
72-
db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0]))
74+
db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(&b[0]))
7375
db.datasz = sz
7476
return nil
7577
}

bolt_android.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"unsafe"
88

99
"golang.org/x/sys/unix"
10+
11+
"go.etcd.io/bbolt/internal/common"
1012
)
1113

1214
// flock acquires an advisory lock on a file descriptor.
@@ -69,7 +71,7 @@ func mmap(db *DB, sz int) error {
6971

7072
// Save the original byte slice and convert to a byte array pointer.
7173
db.dataref = b
72-
db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0]))
74+
db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(&b[0]))
7375
db.datasz = sz
7476
return nil
7577
}

bolt_solaris.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"unsafe"
88

99
"golang.org/x/sys/unix"
10+
11+
"go.etcd.io/bbolt/internal/common"
1012
)
1113

1214
// flock acquires an advisory lock on a file descriptor.
@@ -67,7 +69,7 @@ func mmap(db *DB, sz int) error {
6769

6870
// Save the original byte slice and convert to a byte array pointer.
6971
db.dataref = b
70-
db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0]))
72+
db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(&b[0]))
7173
db.datasz = sz
7274
return nil
7375
}

0 commit comments

Comments
 (0)