Skip to content

Commit 6716939

Browse files
committed
fix: wrong mmap flags
1 parent 0919261 commit 6716939

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mmapallocator/mmap.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package mmapallocator
22

33
import (
44
"os"
5-
"syscall"
65
"unsafe"
76

87
"github.com/edsrzf/mmap-go"
@@ -53,7 +52,7 @@ func mmap_alloc(allocator unsafe.Pointer, size int) unsafe.Pointer {
5352

5453
if viableChunk == nil {
5554
totalSize := int(mm.Align(uintptr(size)+sizeOfChunk+sizeOfPtrMeta, uintptr(pageSize)))
56-
res, err := mmap.MapRegion(nil, totalSize, syscall.PROT_READ|syscall.PROT_WRITE, mmap.ANON|mmap.RDWR, 0)
55+
res, err := mmap.MapRegion(nil, totalSize, mmap.RDWR, mmap.ANON, 0)
5756
if err != nil {
5857
panic(err)
5958
}

0 commit comments

Comments
 (0)