Skip to content

Commit a7f2a45

Browse files
Apply suggested fix to src/ds/slot_arena.rs from Copilot Autofix (#33)
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent e0fc25b commit a7f2a45

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/ds/slot_arena.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@
142142
//!
143143
//! ## Implementation Notes
144144
//!
145-
//! - `SlotId` carries a generation counter; stale handles return `None`
145+
//! - `SlotId` stores the generation value assigned by the arena; the arena
146+
//! maintains the authoritative generation counter and validates `SlotId`s
147+
//! against it so that stale handles return `None`
146148
//! - Physical slot indices may be reused after removal, but the
147149
//! generation counter prevents ABA hazards
148150
//! - `len()` tracks live entries, not `slots.len()`

0 commit comments

Comments
 (0)