(fr memmap.FileRange)
| 1132 | } |
| 1133 | |
| 1134 | func (f *MemoryFile) decommitOrManuallyZero(fr memmap.FileRange) { |
| 1135 | if err := f.decommitFile(fr); err != nil { |
| 1136 | log.Warningf("Failed to decommit %v: %v", fr, err) |
| 1137 | // Zero the pages manually. This won't reduce memory usage, but at |
| 1138 | // least ensures that the pages will be zeroed when reallocated. |
| 1139 | f.manuallyZero(fr) |
| 1140 | } |
| 1141 | } |
| 1142 | |
| 1143 | // HasUniqueRef returns true if all pages in the given range have exactly one |
| 1144 | // reference. A return value of false is inherently racy, but if the caller |
no test coverage detected