Skip to content

Commit 2ea902b

Browse files
committed
More comments
1 parent 1e021d3 commit 2ea902b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/source/buffered.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ where
7575
fn drop(&mut self) {
7676
// This is necessary to prevent stack overflows deallocating long chains of the mutually
7777
// 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.
78+
// 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.
7982
loop {
8083
if let Ok(arc_next) = self.next.get_mut() {
8184
if let Some(next_ref) = Arc::get_mut(arc_next) {

0 commit comments

Comments
 (0)