Skip to content

Expose stable cell identity across relocation #39

Description

@chrisbbreuer

Consumer: zig-utils/zig-js#403

Heap snapshots need a process-unique cell identifier that survives moving compaction. zig-gc already memcpy-copies the complete header during relocation, so identity belongs in collector metadata rather than an embedder pointer map that would go stale.

Scope

  • Add a process-unique nonzero StableCellId to every published cell header.
  • Preserve the ID automatically across relocation and never recycle it during the process lifetime.
  • Expose a read-only quiescent cellMetadata/stable-ID query without exposing mutable headers.
  • Cover single and batch allocation, independent heaps, unknown pointers, reclamation/address reuse, and compaction.
  • Keep allocation publication race-free and document the quiescent query contract.
  • Run focused Debug/ReleaseSafe collector evidence.
  • Close on green CI.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions