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

Method stack_index_mut

crates/vm/src/frame.rs:354–359  ·  view source on GitHub ↗
(&mut self, idx: usize)

Source from the content-addressed store, hash-verified

352 /// Get a mutable reference to a stack slot by index from the bottom.
353 #[inline(always)]
354 fn stack_index_mut(&mut self, idx: usize) -> &mut Option<PyStackRef> {
355 debug_assert!(idx < self.stack_top as usize);
356 let raw_idx = self.nlocalsplus as usize + idx;
357 let data = self.data_as_mut_slice();
358 unsafe { &mut *(data.as_mut_ptr().add(raw_idx) as *mut Option<PyStackRef>) }
359 }
360
361 /// Get the last stack element (top of stack).
362 #[inline(always)]

Callers 3

stack_last_mutMethod · 0.80

Calls 3

data_as_mut_sliceMethod · 0.80
as_mut_ptrMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected