Skip to content

Phase 1: GC Interface Abstraction #2

@usiegj00

Description

@usiegj00

Part of #1

Extract Crystal's GC calls behind an abstract interface so different GC backends can be swapped at compile time.

Scope

  • Define CrystalGC module interface: alloc, alloc_atomic, collect, stats, enumerate_objects, register_stack, unregister_stack
  • Implement CrystalGC::Boehm wrapping current LibGC calls
  • Replace direct LibGC calls in src/gc/boehm.cr with interface calls
  • Zero behavior change — all existing tests must pass

Key Files

  • src/gc/boehm.cr — current GC integration
  • New: src/gc/interface.cr — abstract interface

Upstreamable

Yes — this is a non-breaking refactor. Can be proposed to crystal-lang/crystal as-is.

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