Clear evaluation stack and state-owned cell/free references. For full local/cell cleanup, call `clear_locals_and_stack()`.
(&self)
| 781 | /// Clear evaluation stack and state-owned cell/free references. |
| 782 | /// For full local/cell cleanup, call `clear_locals_and_stack()`. |
| 783 | pub(crate) fn clear_stack_and_cells(&self) { |
| 784 | // SAFETY: Called when frame is not executing (generator closed). |
| 785 | // Cell refs in fastlocals[nlocals..] are cleared by clear_locals_and_stack(). |
| 786 | unsafe { |
| 787 | (*self.iframe.get()).localsplus.stack_clear(); |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | /// Clear locals and stack after generator/coroutine close. |
| 792 | /// Releases references held by the frame, matching _PyFrame_ClearLocals. |
no test coverage detected