(fr memmap.FileRange)
| 1115 | } |
| 1116 | |
| 1117 | func (f *MemoryFile) decommitFile(fr memmap.FileRange) error { |
| 1118 | // "After a successful call, subsequent reads from this range will |
| 1119 | // return zeroes. The FALLOC_FL_PUNCH_HOLE flag must be ORed with |
| 1120 | // FALLOC_FL_KEEP_SIZE in mode ..." - fallocate(2) |
| 1121 | return unix.Fallocate( |
| 1122 | int(f.file.Fd()), |
| 1123 | unix.FALLOC_FL_PUNCH_HOLE|unix.FALLOC_FL_KEEP_SIZE, |
| 1124 | int64(fr.Start), |
| 1125 | int64(fr.Length())) |
| 1126 | } |
| 1127 | |
| 1128 | func (f *MemoryFile) manuallyZero(fr memmap.FileRange) { |
| 1129 | f.forEachMappingSlice(fr, func(bs []byte) { |
no test coverage detected