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:
-
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. -
Incremental marking: When a marking cycle is active (
is_marking()), the dispatch loop callsgc_incremental_mark_step()every 1024 instructions to make bounded progress on the gray worklist without stopping the world. -
Full STW (fallback): The original
collect()path, used when the scheduler recommendsCollectionType::Fullor when no scheduler is enabled.
Traits§
- GCIntegration
- Garbage collection integration for VirtualMachine