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

Method stack_clear

crates/vm/src/frame.rs:399–403  ·  view source on GitHub ↗

Clear the stack, dropping all values.

(&mut self)

Source from the content-addressed store, hash-verified

397
398 /// Clear the stack, dropping all values.
399 fn stack_clear(&mut self) {
400 while self.stack_top > 0 {
401 let _ = self.stack_pop();
402 }
403 }
404
405 /// Drain stack elements from `from` to the end, returning an iterator
406 /// that yields `Option<PyStackRef>` in forward order and shrinks the stack.

Callers 2

drop_valuesMethod · 0.80
clear_stack_and_cellsMethod · 0.80

Calls 1

stack_popMethod · 0.80

Tested by

no test coverage detected