MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / increment_generation

Method increment_generation

src/sharedref.rs:270–275  ·  view source on GitHub ↗
(&self, py: Python)

Source from the content-addressed store, hash-verified

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

Callers 1

try_borrow_mutMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected