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

Method freelist_pop

crates/vm/src/builtins/tuple.rs:134–148  ·  view source on GitHub ↗
(payload: &Self)

Source from the content-addressed store, hash-verified

132
133 #[inline]
134 unsafe fn freelist_pop(payload: &Self) -> Option<NonNull<PyObject>> {
135 let len = payload.elements.len();
136 if len == 0 || len > TupleFreeList::MAX_SAVE_SIZE {
137 return None;
138 }
139 TUPLE_FREELIST
140 .try_with(|fl| {
141 let mut list = fl.take();
142 let result = list.buckets[len - 1].pop();
143 fl.set(list);
144 result
145 })
146 .ok()
147 .flatten()
148 }
149}
150
151pub trait IntoPyTuple {

Callers

nothing calls this directly

Calls 6

okMethod · 0.80
lenMethod · 0.45
flattenMethod · 0.45
takeMethod · 0.45
popMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected