MCPcopy
hub / github.com/dgraph-io/badger / munmap

Method munmap

value.go:203–216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

201}
202
203func (lf *logFile) munmap() (err error) {
204 if lf.loadingMode != options.MemoryMap || len(lf.fmap) == 0 {
205 // Nothing to do
206 return nil
207 }
208
209 if err := y.Munmap(lf.fmap); err != nil {
210 return errors.Wrapf(err, "Unable to munmap value log: %q", lf.path)
211 }
212 // This is important. We should set the map to nil because ummap
213 // system call doesn't change the length or capacity of the fmap slice.
214 lf.fmap = nil
215 return nil
216}
217
218// Acquire lock on mmap/file if you are calling this
219func (lf *logFile) read(p valuePointer, s *y.Slice) (buf []byte, err error) {

Callers 3

doneWritingMethod · 0.95
deleteLogFileMethod · 0.80
CloseMethod · 0.80

Calls 1

MunmapFunction · 0.92

Tested by

no test coverage detected