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

Method push

crates/vm/src/datastack.rs:85–96  ·  view source on GitHub ↗
(&mut self, size: usize)

Source from the content-addressed store, hash-verified

83 /// (LIFO order).
84 #[inline(always)]
85 pub fn push(&mut self, size: usize) -> *mut u8 {
86 let aligned_size = (size + ALIGN - 1) & !(ALIGN - 1);
87 unsafe {
88 if self.top.add(aligned_size) <= self.limit {
89 let ptr = self.top;
90 self.top = self.top.add(aligned_size);
91 ptr
92 } else {
93 self.push_slow(aligned_size)
94 }
95 }
96 }
97
98 /// Slow path: allocate a new chunk and push from it.
99 #[cold]

Callers 15

mainFunction · 0.45
parseMethod · 0.45
unpackMethod · 0.45
parse_groupingFunction · 0.45
add_noteMethod · 0.45
syntax_error_set_msgFunction · 0.45
__reduce__Method · 0.45
prep_reraise_starFunction · 0.45
split_by_leaf_idsFunction · 0.45
py_bytes_splitlinesMethod · 0.45
registerMethod · 0.45

Calls 2

push_slowMethod · 0.80
addMethod · 0.45

Tested by 3

basic_push_popFunction · 0.36
cross_chunk_push_popFunction · 0.36
alignmentFunction · 0.36