IncRef implements memmap.File.IncRef.
(fr memmap.FileRange, memCgID uint32)
| 1169 | |
| 1170 | // IncRef implements memmap.File.IncRef. |
| 1171 | func (f *MemoryFile) IncRef(fr memmap.FileRange, memCgID uint32) { |
| 1172 | if !fr.WellFormed() || fr.Length() == 0 || !hostarch.IsPageAligned(fr.Start) || !hostarch.IsPageAligned(fr.End) { |
| 1173 | panic(fmt.Sprintf("invalid range: %v", fr)) |
| 1174 | } |
| 1175 | |
| 1176 | f.mu.Lock() |
| 1177 | defer f.mu.Unlock() |
| 1178 | f.incRefLocked(fr) |
| 1179 | } |
| 1180 | |
| 1181 | // Preconditions: f.mu must be locked. |
| 1182 | func (f *MemoryFile) incRefLocked(fr memmap.FileRange) { |
nothing calls this directly
no test coverage detected