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

Method freelist_pop

crates/vm/src/builtins/slice.rs:79–89  ·  view source on GitHub ↗
(_payload: &Self)

Source from the content-addressed store, hash-verified

77
78 #[inline]
79 unsafe fn freelist_pop(_payload: &Self) -> Option<NonNull<PyObject>> {
80 SLICE_FREELIST
81 .try_with(|fl| {
82 let mut list = fl.take();
83 let result = list.pop().map(|p| unsafe { NonNull::new_unchecked(p) });
84 fl.set(list);
85 result
86 })
87 .ok()
88 .flatten()
89 }
90}
91
92#[pyclass(with(Comparable, Representable, Hashable))]

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected