Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup gc visitation in streams readers and writers #1598

Closed
wants to merge 2 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Jan 31, 2024

PR does a couple of things:

  1. Ensures the the Reader/Writer is gc visiting the strong ref to the ReadableStream/WritableStream
  2. Switches to uses a WeakRef rather than a Maybe bare ref from the ReadableStream/WritableStream to the Reader

@jasnell jasnell requested review from a team as code owners January 31, 2024 17:06
@jasnell jasnell force-pushed the jsnell/fix-gcvisiting-streams-writers-readers branch from 3a909a4 to 20d3ef5 Compare January 31, 2024 17:28
@jasnell

This comment was marked as resolved.

@jasnell jasnell marked this pull request as draft January 31, 2024 18:10
@jasnell jasnell marked this pull request as ready for review January 31, 2024 21:18
Copy link
Member

@kentonv kentonv left a comment

Choose a reason for hiding this comment

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

Does the change to WeakRef fix a problem or is it just aesthetics? I personally find it more confusing, and I worry that the complexity of the commit could hide new bugs. If it doesn't fix a bug I'd prefer to drop that commit on the basis of "if it ain't broke, don't fix it"...

src/workerd/api/streams/readable.c++ Outdated Show resolved Hide resolved
@jasnell jasnell force-pushed the jsnell/fix-gcvisiting-streams-writers-readers branch from 2bf2bef to 918f104 Compare February 1, 2024 19:54
@jasnell
Copy link
Member Author

jasnell commented Feb 1, 2024

Does the change to WeakRef fix a problem or is it just aesthetics? ...

Fixes a problem in the cleanup ordering that was masked by the memory leak.

@jasnell jasnell force-pushed the jsnell/fix-gcvisiting-streams-writers-readers branch from 918f104 to 5e78eaa Compare February 1, 2024 19:59
@jasnell
Copy link
Member Author

jasnell commented Feb 2, 2024

Superseded by #1606

@jasnell jasnell closed this Feb 2, 2024
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.

2 participants