Source File
file_linux.go
Belonging Package
github.com/dgraph-io/ristretto/v2/z
/** SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>* SPDX-License-Identifier: Apache-2.0*/package zimport ()// Truncate would truncate the mmapped file to the given size. On Linux, we truncate// the underlying file and then call mremap, but on other systems, we unmap first,// then truncate, then re-map.func ( *MmapFile) ( int64) error {if := .Sync(); != nil {return fmt.Errorf("while sync file: %s, error: %v\n", .Fd.Name(), )}if := .Fd.Truncate(); != nil {return fmt.Errorf("while truncate file: %s, error: %v\n", .Fd.Name(), )}var error.Data, = mremap(.Data, int()) // Mmap up to max size.return}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |