Skip to content

feat(gc): make WeakMap::get return a reference instead of cloning#4938

Open
shruti2522 wants to merge 1 commit intoboa-dev:mainfrom
shruti2522:ref
Open

feat(gc): make WeakMap::get return a reference instead of cloning#4938
shruti2522 wants to merge 1 commit intoboa-dev:mainfrom
shruti2522:ref

Conversation

@shruti2522
Copy link

This Pull Request fixes/closes #{issue_num}.

It changes the following:

WeakMap::get now returns an Option<GcRef<'_, V>> instead of Option<V>

@shruti2522 shruti2522 requested a review from a team as a code owner March 8, 2026 00:14
@github-actions
Copy link

github-actions bot commented Mar 8, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 49,687 49,687 0
Ignored 2,262 2,262 0
Failed 1,014 1,014 0
Panics 0 0 0
Conformance 93.81% 93.81% 0.00%

Tested main commit: b3d820369072123ded8defc927405b99b9012648
Tested PR commit: f69557f44c8ca23d8154f35edf68bf27d397131e
Compare commits: b3d8203...f69557f

@jedel1043
Copy link
Member

This is unsound. If you get a reference to the inner value of the ephemeron and a garbage collection occurs, you could be left with a reference to deallocated data.

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