MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / reserve_slow

Method reserve_slow

src/fast.rs:94–106  ·  view source on GitHub ↗
(me: &mut FastVec<T>, additional: usize)

Source from the content-addressed store, hash-verified

92 #[cold]
93 #[inline(never)]
94 fn reserve_slow<T>(me: &mut FastVec<T>, additional: usize) {
95 // Safety: `Vec::reserve` panics on OOM without freeing Vec, so Vec is unmodified.
96 unsafe {
97 me.mut_vec(|v| {
98 // Optimizes out a redundant check in `Vec::reserve`.
99 // Safety: we've already ensured this condition before calling reserve_slow.
100 if additional <= v.capacity().wrapping_sub(v.len()) {
101 std::hint::unreachable_unchecked();
102 }
103 v.reserve(additional);
104 });
105 }
106 }
107 reserve_slow(self, additional);
108 }
109 }

Callers

nothing calls this directly

Calls 3

mut_vecMethod · 0.80
lenMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected