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

Method freelist_pop

crates/vm/src/builtins/list.rs:111–121  ·  view source on GitHub ↗
(_payload: &Self)

Source from the content-addressed store, hash-verified

109
110 #[inline]
111 unsafe fn freelist_pop(_payload: &Self) -> Option<NonNull<PyObject>> {
112 LIST_FREELIST
113 .try_with(|fl| {
114 let mut list = fl.take();
115 let result = list.pop().map(|p| unsafe { NonNull::new_unchecked(p) });
116 fl.set(list);
117 result
118 })
119 .ok()
120 .flatten()
121 }
122}
123
124impl ToPyObject for Vec<PyObjectRef> {

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