@@ -66,9 +66,6 @@ enum UnwindReason {
6666 Raising { exception : PyBaseExceptionRef } ,
6767}
6868
69- // FrameState fields are stored directly on Frame as UnsafeCell.
70- // See Frame.localsplus, Frame.cells_frees, Frame.prev_line.
71-
7269/// Tracks who owns a frame.
7370// = `_PyFrameOwner`
7471#[ repr( i8 ) ]
@@ -203,7 +200,6 @@ impl LocalsPlus {
203200 fn materialize_to_heap ( & mut self ) -> Option < * mut u8 > {
204201 if let LocalsPlusData :: DataStack { ptr, capacity } = & self . data {
205202 let base = * ptr as * mut u8 ;
206- // Copy all data to a heap allocation (preserves locals for tracebacks).
207203 let heap_data = unsafe { core:: slice:: from_raw_parts ( * ptr, * capacity) }
208204 . to_vec ( )
209205 . into_boxed_slice ( ) ;
@@ -461,7 +457,6 @@ impl ExactSizeIterator for LocalsPlusStackDrain<'_> {}
461457
462458impl Drop for LocalsPlusStackDrain < ' _ > {
463459 fn drop ( & mut self ) {
464- // Drop any remaining elements that weren't consumed.
465460 while self . current < self . end {
466461 let idx = self . localsplus . nlocalsplus as usize + self . current ;
467462 let data = self . localsplus . data_as_mut_slice ( ) ;
@@ -671,7 +666,6 @@ impl Frame {
671666 . chain ( closure. iter ( ) . cloned ( ) )
672667 . collect ( ) ;
673668
674- // Create unified localsplus: varnames + cellvars + freevars + stack
675669 let nlocalsplus = nlocals
676670 . checked_add ( num_cells)
677671 . and_then ( |v| v. checked_add ( nfrees) )
@@ -1001,8 +995,8 @@ impl Py<Frame> {
1001995 }
1002996}
1003997
1004- /// An executing frame; essentially just a struct to combine the immutable data outside the mutex
1005- /// with the mutable data inside
998+ /// An executing frame; borrows mutable frame-internal data for the duration
999+ /// of bytecode execution.
10061000struct ExecutingFrame < ' a > {
10071001 code : & ' a PyRef < PyCode > ,
10081002 localsplus : & ' a mut LocalsPlus ,
0 commit comments