Skip to content

refactor: add MutationContext for Gc allocations - #5458

Merged
jedel1043 merged 1 commit into
boa-dev:dev/oscars-gcfrom
shruti2522:integration3
Jul 25, 2026
Merged

refactor: add MutationContext for Gc allocations#5458
jedel1043 merged 1 commit into
boa-dev:dev/oscars-gcfrom
shruti2522:integration3

Conversation

@shruti2522

Copy link
Copy Markdown
Contributor

this is a follow up to the previous PR #5446 that introduced the 'gc lifetime, we now require a valid MutationContext for all gc pointers in boa_gc
We must pass it to Gc::new, WeakGc::upgrade, Ephemeron and WeakMap, this stops pointers from living longer than they are supposed to.

To keep the engine compiling, I added a fake MutationContext::dummy()
to use as a temporary patch until we pass the real context

@github-actions github-actions Bot added Waiting On Review Waiting on reviews from the maintainers C-Tests Issues and PRs related to the tests. C-Builtins PRs and Issues related to builtins/intrinsics C-VM Issues and PRs related to the Boa Virtual Machine. C-GC Issue related to garbage collection C-Runtime Issues and PRs related to Boa's runtime features labels Jul 25, 2026
@github-actions github-actions Bot added this to the v1.0.0 milestone Jul 25, 2026
@shruti2522 shruti2522 changed the title Integration3 refactor: add MutationContext for Gc allocations Jul 25, 2026
@shruti2522
shruti2522 marked this pull request as ready for review July 25, 2026 23:27
@shruti2522
shruti2522 requested a review from a team as a code owner July 25, 2026 23:27

@jedel1043 jedel1043 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!

@jedel1043
jedel1043 merged commit 8e5dee5 into boa-dev:dev/oscars-gc Jul 25, 2026
2 checks passed
@github-actions github-actions Bot removed the Waiting On Review Waiting on reviews from the maintainers label Jul 25, 2026
@jedel1043

Copy link
Copy Markdown
Member

Also, on your next PR you might want to enable CI by adding the dev/oscars-gc branch to the CI file

@shruti2522

Copy link
Copy Markdown
Contributor Author

Also, on your next PR you might want to enable CI by adding the dev/oscars-gc branch to the CI file

sure!

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

Labels

C-Builtins PRs and Issues related to builtins/intrinsics C-GC Issue related to garbage collection C-Runtime Issues and PRs related to Boa's runtime features C-Tests Issues and PRs related to the tests. C-VM Issues and PRs related to the Boa Virtual Machine.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants