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

Method freelist_push

crates/vm/src/builtins/dict.rs:81–95  ·  view source on GitHub ↗
(obj: *mut PyObject)

Source from the content-addressed store, hash-verified

79
80 #[inline]
81 unsafe fn freelist_push(obj: *mut PyObject) -> bool {
82 DICT_FREELIST
83 .try_with(|fl| {
84 let mut list = fl.take();
85 let stored = if list.len() < Self::MAX_FREELIST {
86 list.push(obj);
87 true
88 } else {
89 false
90 };
91 fl.set(list);
92 stored
93 })
94 .unwrap_or(false)
95 }
96
97 #[inline]
98 unsafe fn freelist_pop(_payload: &Self) -> Option<NonNull<PyObject>> {

Callers

nothing calls this directly

Calls 4

takeMethod · 0.45
lenMethod · 0.45
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected