True if the periodic-flush thresholds (ops or elapsed) are tripped.
(&self)
| 133 | |
| 134 | /// True if the periodic-flush thresholds (ops or elapsed) are tripped. |
| 135 | pub fn should_flush(&self) -> bool { |
| 136 | if self.allocs_since_flush.load(Ordering::Acquire) >= FLUSH_OPS_THRESHOLD { |
| 137 | return true; |
| 138 | } |
| 139 | if let Ok(last) = self.last_flush_at.lock() { |
| 140 | return last.elapsed() >= FLUSH_ELAPSED_THRESHOLD; |
| 141 | } |
| 142 | false |
| 143 | } |
| 144 | |
| 145 | /// Idempotently raise the high-watermark to at least `new_hwm`. |
| 146 | /// Used by WAL replay: each replayed `SurrogateAlloc` record advances |
no test coverage detected