Skip to main content

Module gc_integration

Module gc_integration 

Source
Expand description

Garbage collection integration for the VM

Without gc feature: no-ops (all values use Arc reference counting). With gc feature: real root scanning, safepoint polling, and GC triggering.

§Collection strategies (gc feature)

The VM integrates three collection strategies from shape-gc:

  1. Generational (Young/Old): Uses collect_young() / collect_old() via the adaptive scheduler to minimize pause times. Young-gen collections are fast and frequent; old-gen collections happen predictively.

  2. Incremental marking: When a marking cycle is active (is_marking()), the dispatch loop calls gc_incremental_mark_step() every 1024 instructions to make bounded progress on the gray worklist without stopping the world.

  3. Full STW (fallback): The original collect() path, used when the scheduler recommends CollectionType::Full or when no scheduler is enabled.

Traits§

GCIntegration
Garbage collection integration for VirtualMachine