lib/fs: fix GOOS=windows build after f8baf29b6e

This commit is contained in:
Aliaksandr Valialkin 2024-03-01 01:43:06 +02:00
parent d62b14685a
commit c8c2c5f8e5
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -3,7 +3,6 @@ package fs
import (
"fmt"
"os"
"reflect"
"sync"
"unsafe"
@ -89,7 +88,7 @@ func mmap(fd int, length int) ([]byte, error) {
windows.CloseHandle(h)
return nil, os.NewSyscallError("MapViewOfFile", errno)
}
data := unsafe.Slice(addr, length)
data := unsafe.Slice((*byte)(unsafe.Pointer(addr)), length)
mmapByAddrLock.Lock()
mmapByAddr[addr] = h