pr3.5
This commit is contained in:
@@ -1,54 +1,3 @@
|
||||
# PR-3.5 — Implement Mark Phase (Reachability Traversal)
|
||||
|
||||
### Briefing
|
||||
|
||||
This PR introduces the mark phase of a simple mark-sweep collector. It must traverse from roots and mark reachable objects.
|
||||
|
||||
### Target
|
||||
|
||||
* Implement reachability marking from root set.
|
||||
* Set mark bits on visited objects.
|
||||
|
||||
### Work items
|
||||
|
||||
* Implement a `mark()` function in the heap.
|
||||
* Traverse roots using the root iterator.
|
||||
* For each `HeapRef`, mark the object.
|
||||
* Recursively traverse references inside objects.
|
||||
* Ensure no infinite loops on cycles.
|
||||
|
||||
### Acceptance checklist
|
||||
|
||||
* [ ] Mark phase visits all reachable objects.
|
||||
* [ ] Cycles are handled safely.
|
||||
* [ ] Unreachable objects remain unmarked.
|
||||
* [ ] `cargo test` passes.
|
||||
|
||||
### Tests
|
||||
|
||||
* Add tests:
|
||||
|
||||
* Reachable object stays marked.
|
||||
* Unreachable object remains unmarked.
|
||||
* Cyclic references do not crash.
|
||||
|
||||
### Junie instructions
|
||||
|
||||
**You MAY:**
|
||||
|
||||
* Implement a simple DFS or stack-based marking.
|
||||
|
||||
**You MUST NOT:**
|
||||
|
||||
* Add generational, incremental, or parallel GC.
|
||||
* Change object layout.
|
||||
|
||||
**If unclear:**
|
||||
|
||||
* Ask before deciding traversal structure.
|
||||
|
||||
---
|
||||
|
||||
# PR-3.6 — Implement Sweep Phase (Reclaim Unmarked Objects)
|
||||
|
||||
### Briefing
|
||||
|
||||
Reference in New Issue
Block a user