Skip to content

gc: add finalizer_safe() parity API across mark-sweep collectors#79

Open
Flamki wants to merge 1 commit intoboa-dev:mainfrom
Flamki:feat/finalizer-safe-parity
Open

gc: add finalizer_safe() parity API across mark-sweep collectors#79
Flamki wants to merge 1 commit intoboa-dev:mainfrom
Flamki:feat/finalizer-safe-parity

Conversation

@Flamki
Copy link
Copy Markdown
Contributor

@Flamki Flamki commented Apr 12, 2026

Part of #78 and #63.

This PR adds finalizer_safe() runtime utility parity in both mark-sweep collectors and validates its behavior with focused tests.

What changed

  • Added MarkSweepGarbageCollector::finalizer_safe(&self) -> bool in:
    • collectors/mark_sweep/mod.rs
    • collectors/mark_sweep_arena2/mod.rs
  • Added parity tests in both collector test suites:
    • finalizer_safe_reflects_collecting_state

Behavior validated by tests

  • finalizer_safe() returns true while idle.
  • finalizer_safe() returns false when observed from inside Trace::trace during an active collection cycle.
  • After collection completes, finalizer_safe() returns true again.

Scope

  • runtime utility parity + tests only
  • no allocator policy changes
  • no collector algorithm changes
  • no Boa integration wiring changes

Validation

  • cargo fmt --all -- --check
  • cargo test --workspace -q
  • cargo clippy --workspace --all-features --all-targets -q
  • cargo +nightly miri test -p oscars --all-features -q

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.

1 participant