We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e021d3 commit 2ea902bCopy full SHA for 2ea902b
1 file changed
src/source/buffered.rs
@@ -75,7 +75,10 @@ where
75
fn drop(&mut self) {
76
// This is necessary to prevent stack overflows deallocating long chains of the mutually
77
// recursive `Frame` and `FrameData` types. This iteratively traverses as much of the
78
- // chain as needs to be deallocated, and repeatedly "pops" the head off the list.
+ // chain as needs to be deallocated, and repeatedly "pops" the head off the list. This
79
+ // solves the problem, as when the time comes to actually deallocate the `FrameData`,
80
+ // the `next` field will contain a `Frame::End`, or an `Arc` with additional references,
81
+ // so the depth of recursive drops will be bounded.
82
loop {
83
if let Ok(arc_next) = self.next.get_mut() {
84
if let Some(next_ref) = Arc::get_mut(arc_next) {
0 commit comments