Skip to content

script: Use interior mutability for stream controller queues.#40138

Merged
jdm merged 1 commit intoservo:mainfrom
jdm:stream-borrow-hazard
Oct 25, 2025
Merged

script: Use interior mutability for stream controller queues.#40138
jdm merged 1 commit intoservo:mainfrom
jdm:stream-borrow-hazard

Conversation

@jdm
Copy link
Copy Markdown
Member

@jdm jdm commented Oct 24, 2025

The stream controller code has many instances of mutably borrowing the queue and then invoking an operation that can trigger a GC. To avoid that, we need to make the queue mutability more granular with interior mutability.

Testing: Many stream tests no longer crash when using a debug mozjs build and full GC zeal. This configuration is not run in CI.
Fixes: #39947

@jdm jdm requested a review from gterzian as a code owner October 24, 2025 18:48
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 24, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Oct 24, 2025
@jdm jdm added this pull request to the merge queue Oct 25, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 25, 2025
Merged via the queue into servo:main with commit 9987656 Oct 25, 2025
33 checks passed
@jdm jdm deleted the stream-borrow-hazard branch October 25, 2025 01:02
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 25, 2025
@Taym95
Copy link
Copy Markdown
Member

Taym95 commented Oct 25, 2025

Good catch 🚀

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.

Borrow hazard in ReadableStreamDefaultController::dequeue_value

4 participants