From fef2d5974f2ed6ae29c8a78d91fa886e53be6151 Mon Sep 17 00:00:00 2001 From: Andrey Yarysh Date: Fri, 20 Aug 2021 09:23:40 +0200 Subject: [PATCH] Remove mmapSize check, it has wrong value on ARM64 --- z/mmap_linux.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/z/mmap_linux.go b/z/mmap_linux.go index 9cc3497a..8843e424 100644 --- a/z/mmap_linux.go +++ b/z/mmap_linux.go @@ -17,7 +17,6 @@ package z import ( - "fmt" "os" "reflect" "unsafe" @@ -41,7 +40,7 @@ func mremap(data []byte, size int) ([]byte, error) { const MREMAP_MAYMOVE = 0x1 header := (*reflect.SliceHeader)(unsafe.Pointer(&data)) - mmapAddr, mmapSize, errno := unix.Syscall6( + mmapAddr, _, errno := unix.Syscall6( unix.SYS_MREMAP, header.Data, uintptr(header.Len), @@ -53,9 +52,6 @@ func mremap(data []byte, size int) ([]byte, error) { if errno != 0 { return nil, errno } - if mmapSize != uintptr(size) { - return nil, fmt.Errorf("mremap size mismatch: requested: %d got: %d", size, mmapSize) - } header.Data = mmapAddr header.Cap = size