This commit is contained in:
2026-03-24 13:40:38 +00:00
parent 966f0f9a8f
commit 3297980055
2 changed files with 106 additions and 71 deletions
-51
View File
@@ -1,54 +1,3 @@
# PR-3.6 — Implement Sweep Phase (Reclaim Unmarked Objects)
### Briefing
After marking, the GC must reclaim unreachable objects. This PR implements the sweep phase.
### Target
* Remove or reclaim unmarked objects.
* Reset mark bits for the next cycle.
### Work items
* Iterate over heap storage.
* For each object:
* If unmarked, reclaim it.
* If marked, clear the mark bit.
* Ensure handles to reclaimed objects become invalid or reused safely.
### Acceptance checklist
* [ ] Unreachable objects are reclaimed.
* [ ] Reachable objects remain intact.
* [ ] Mark bits are cleared after sweep.
* [ ] `cargo test` passes.
### Tests
* Add tests:
* Allocate objects, drop references, run sweep, confirm removal.
* Confirm live objects survive.
### Junie instructions
**You MAY:**
* Implement a simple sweep over the heap vector.
**You MUST NOT:**
* Implement compaction or handle relocation.
* Introduce advanced memory strategies.
**If unclear:**
* Ask before choosing handle invalidation strategy.
---
# PR-3.7 — Integrate GC Cycle at Safepoint (`FRAME_SYNC`)
### Briefing