Update the limit dynamically (for rebalancing). The new limit must be >= current allocation. If it's less, the limit is set to the current allocation (no immediate eviction).
(&self, new_limit: usize)
| 213 | /// The new limit must be >= current allocation. If it's less, the limit |
| 214 | /// is set to the current allocation (no immediate eviction). |
| 215 | pub fn set_limit(&self, new_limit: usize) { |
| 216 | let allocated = self.allocated(); |
| 217 | let effective = new_limit.max(allocated); |
| 218 | self.limit.store(effective, Ordering::Release); |
| 219 | } |
| 220 | |
| 221 | /// Reset all counters (for testing). |
| 222 | #[cfg(test)] |