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

Method freelist_push

crates/vm/src/builtins/range.rs:87–101  ·  view source on GitHub ↗
(obj: *mut PyObject)

Source from the content-addressed store, hash-verified

85
86 #[inline]
87 unsafe fn freelist_push(obj: *mut PyObject) -> bool {
88 RANGE_FREELIST
89 .try_with(|fl| {
90 let mut list = fl.take();
91 let stored = if list.len() < Self::MAX_FREELIST {
92 list.push(obj);
93 true
94 } else {
95 false
96 };
97 fl.set(list);
98 stored
99 })
100 .unwrap_or(false)
101 }
102
103 #[inline]
104 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