MCPcopy Index your code
hub / github.com/RustPython/RustPython / inc_by

Method inc_by

crates/common/src/refcount.rs:112–118  ·  view source on GitHub ↗
(&self, n: usize)

Source from the content-addressed store, hash-verified

110
111 #[inline]
112 pub fn inc_by(&self, n: usize) {
113 debug_assert!(n <= STRONG);
114 let val = State::from_raw(self.state.fetch_add(n * COUNT, Ordering::Relaxed));
115 if val.destructed() || (val.strong() as usize) > STRONG - n {
116 refcount_overflow();
117 }
118 }
119
120 /// Returns true if successful
121 #[inline]

Callers 1

call_slot_delMethod · 0.80

Calls 3

refcount_overflowFunction · 0.85
destructedMethod · 0.80
strongMethod · 0.80

Tested by

no test coverage detected