Skip to content

gc: add finalizer_safe() runtime utility parity across collectors #78

Description

@Flamki

Context

  • #63 still lists finalizer_safe() as an open runtime utility parity gap.
  • Current collectors already track collection state (is_collecting), but there is no unified public parity surface for this utility.

Problem

  • Boa-facing API compatibility expects a finalizer_safe() style check.
  • Without this, integration work in #26/#28 lacks a direct parity hook for finalizer-phase safety checks.

Proposed scope

  1. Define and document finalizer_safe() parity behavior for Oscars collectors.
  2. Add the API in both mark_sweep and mark_sweep_arena2 surfaces with consistent semantics.
  3. Add focused tests proving expected behavior during and outside collection/finalization-sensitive paths.
  4. Update parity tracking in #63 once implemented.

Non-goals

  • No collector algorithm changes.
  • No allocator policy changes.
  • No broad Boa integration wiring in this issue.

Acceptance criteria

  • finalizer_safe() is available with consistent behavior in both collectors.
  • Tests cover true/false behavior around collection state transitions.
  • Workspace checks pass (fmt, test, clippy, and miri where applicable).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions