mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/fs: properly handle the case when data=nil is passed to mUnmap
This commit is contained in:
parent
c75bfd5b07
commit
e959f54351
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ func mmap(fd int, length int) ([]byte, error) {
|
||||||
func mUnmap(data []byte) error {
|
func mUnmap(data []byte) error {
|
||||||
// flush is not needed, since we perform only reading operation.
|
// flush is not needed, since we perform only reading operation.
|
||||||
// In case of write, additional call FlushViewOfFile must be performed.
|
// 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()
|
mmapByAddrLock.Lock()
|
||||||
h, ok := mmapByAddr[addr]
|
h, ok := mmapByAddr[addr]
|
||||||
|
|
Loading…
Reference in a new issue