Skip to content

Commit

Permalink
Remove mmapSize check, it has wrong value on ARM64 (#281)
Browse files Browse the repository at this point in the history
(cherry picked from commit c2901dc)
  • Loading branch information
yarysh authored and joshua-goldstein committed Sep 18, 2022
1 parent 6391111 commit f4ef4c1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions z/mmap_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package z

import (
"fmt"
"os"
"reflect"
"unsafe"
Expand All @@ -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),
Expand All @@ -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
Expand Down

0 comments on commit f4ef4c1

Please sign in to comment.