()
| 201 | } |
| 202 | |
| 203 | func (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 |
| 219 | func (lf *logFile) read(p valuePointer, s *y.Slice) (buf []byte, err error) { |
no test coverage detected