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

Revert "Fixup gc tracing in EventTarget" #1653

Merged
merged 4 commits into from
Feb 12, 2024

Conversation

kentonv
Copy link
Member

@kentonv kentonv commented Feb 9, 2024

Reverts #1648

This change was not correct, see analysis here:

#1648 (comment)

@kentonv kentonv requested a review from jasnell February 9, 2024 20:51
@kentonv kentonv requested review from a team as code owners February 9, 2024 20:51
@kentonv kentonv requested a review from byule February 9, 2024 20:51
@kentonv
Copy link
Member Author

kentonv commented Feb 9, 2024

Actually, maybe the right thing to do is to visit the handle only via the reference, since that's the only path by which the JS handles are actually accessed.

@kentonv kentonv force-pushed the revert-1648-jsnell/fixup-gctrace-basics branch from 493c3a2 to 1d8ede4 Compare February 9, 2024 21:43
@kentonv
Copy link
Member Author

kentonv commented Feb 9, 2024

Extended this with a better fix.

See comments for details.

I've changed `newNativeHandler()` to return `Own<void>` to make it really clear that the owner is not supposed to access the object.
This ensures that users call `newNativeHandler()` rather than constructing it directly.
@kentonv kentonv force-pushed the revert-1648-jsnell/fixup-gctrace-basics branch from 1d8ede4 to b953f47 Compare February 9, 2024 21:46
This was made strong in a recent refactoring, but it doesn't need to be. EventTarget can remove the reference in the destructor.
@kentonv kentonv force-pushed the revert-1648-jsnell/fixup-gctrace-basics branch from dfebcd3 to 96f5670 Compare February 10, 2024 15:06
@kentonv
Copy link
Member Author

kentonv commented Feb 10, 2024

@kentonv kentonv merged commit ac5ab4d into main Feb 12, 2024
11 checks passed
@kentonv kentonv deleted the revert-1648-jsnell/fixup-gctrace-basics branch February 12, 2024 01:23
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