Skip to content

Conversation

@Paraworker
Copy link
Contributor

Fixes #489

This comment was marked as resolved.

Copy link
Member

@Berrysoft Berrysoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Berrysoft
Copy link
Member

Thanks anyways. I have considered weak refs, but didn't use it because of performance considerations. Now it seems necessary so...

@Berrysoft Berrysoft merged commit 4a5c750 into compio-rs:master Oct 19, 2025
49 checks passed
@Paraworker Paraworker deleted the fix/ref-cycle branch October 19, 2025 13:00
}
}

impl Drop for Runtime {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no. This change may make the runtime panic on drop. The runnables should be dropped in self.enter, or they cannot find the right runtime to cancel the time futures.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I recently discovered that if a Waker is dropped in another thread and the Weak upgrade fails inside schedule, the Runnable end up being dropped in that other thread. I’m currently looking into how async-executor implements this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to forget the runnable in that case...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak when dropping waker after runtime drop

2 participants