(&self, py: Python)
| 268 | } |
| 269 | |
| 270 | fn increment_generation(&self, py: Python) { |
| 271 | assert_eq!(self.current_borrow_count(py), 0); |
| 272 | // this wraps around to the same value if mutably borrowed |
| 273 | // usize::MAX times, which wouldn't happen in practice. |
| 274 | self.generation.fetch_add(1, Ordering::Relaxed); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | /// Helper to keep the borrow count updated while the shared object is |