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

Method freelist_push

crates/vm/src/builtins/slice.rs:62–76  ·  view source on GitHub ↗
(obj: *mut PyObject)

Source from the content-addressed store, hash-verified

60
61 #[inline]
62 unsafe fn freelist_push(obj: *mut PyObject) -> bool {
63 SLICE_FREELIST
64 .try_with(|fl| {
65 let mut list = fl.take();
66 let stored = if list.len() < Self::MAX_FREELIST {
67 list.push(obj);
68 true
69 } else {
70 false
71 };
72 fl.set(list);
73 stored
74 })
75 .unwrap_or(false)
76 }
77
78 #[inline]
79 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