mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 15:29:24 +01:00
lib/fs: properly handle the case when data=nil is passed to mUnmap
This commit is contained in:
parent
22acd84019
commit
ddc61e2309
@ -101,7 +101,7 @@ func mmap(fd int, length int) ([]byte, error) {
|
||||
func mUnmap(data []byte) error {
|
||||
// flush is not needed, since we perform only reading operation.
|
||||
// In case of write, additional call FlushViewOfFile must be performed.
|
||||
addr := uintptr(unsafe.Pointer(&data[0]))
|
||||
addr := uintptr(unsafe.Pointer(unsafe.SliceData(data)))
|
||||
|
||||
mmapByAddrLock.Lock()
|
||||
h, ok := mmapByAddr[addr]
|
||||
|
Loading…
Reference in New Issue
Block a user