Skip to content

[API] Implement Ephemeron and WeakGc API enhancements - #97

Merged
nekevss merged 2 commits into
boa-dev:mainfrom
shruti2522:api-3
Aug 10, 2026
Merged

[API] Implement Ephemeron and WeakGc API enhancements#97
nekevss merged 2 commits into
boa-dev:mainfrom
shruti2522:api-3

Conversation

@shruti2522

@shruti2522 shruti2522 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Stacked on #96 (which is stacked on #95)

  • added ?Sized bounds for Ephemeron and WeakGc in the null collector.
  • added new, key, value, has_value to Ephemeron and new, is_upgradable to WeakGc
  • updated Trace implementations for both types to use the new unsafe fn trace(&self) contract.
  • added dummy() and global() to null_collector_branded::MutationContext
  • Implemented Debug, PartialEq, and Eq for WeakGc

///
/// Must only be called by the garbage collector.
#[inline]
unsafe fn trace_non_roots(&self) {}

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.

question: what's the reason for this API being added in? Is it just to align with the current boa_gc::Trace trait? If so, then we should ideal mark this with a TODO: remove in the future if we are expecting to remove it after integration is complete

@shruti2522
shruti2522 marked this pull request as ready for review August 10, 2026 02:33
@shruti2522 shruti2522 changed the title feat: implement Ephemeron and WeakGc API enhancements [API] Implement Ephemeron and WeakGc API enhancements Aug 10, 2026
@nekevss
nekevss merged commit 9152fab into boa-dev:main Aug 10, 2026
4 checks passed
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