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

Method freelist_pop

crates/vm/src/builtins/dict.rs:98–108  ·  view source on GitHub ↗
(_payload: &Self)

Source from the content-addressed store, hash-verified

96
97 #[inline]
98 unsafe fn freelist_pop(_payload: &Self) -> Option<NonNull<PyObject>> {
99 DICT_FREELIST
100 .try_with(|fl| {
101 let mut list = fl.take();
102 let result = list.pop().map(|p| unsafe { NonNull::new_unchecked(p) });
103 fl.set(list);
104 result
105 })
106 .ok()
107 .flatten()
108 }
109}
110
111impl PyDict {

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