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

Method stack_push

crates/vm/src/frame.rs:297–308  ·  view source on GitHub ↗
(&mut self, val: Option<PyStackRef>)

Source from the content-addressed store, hash-verified

295 /// Push a value onto the evaluation stack.
296 #[inline(always)]
297 fn stack_push(&mut self, val: Option<PyStackRef>) {
298 let idx = self.nlocalsplus as usize + self.stack_top as usize;
299 debug_assert!(
300 idx < self.capacity(),
301 "stack overflow: stack_top={}, capacity={}",
302 self.stack_top,
303 self.stack_capacity()
304 );
305 let data = self.data_as_mut_slice();
306 data[idx] = unsafe { core::mem::transmute::<Option<PyStackRef>, usize>(val) };
307 self.stack_top += 1;
308 }
309
310 /// Try to push; returns Err if stack is full.
311 #[inline(always)]

Callers 1

stack_extendMethod · 0.80

Calls 1

data_as_mut_sliceMethod · 0.80

Tested by

no test coverage detected