| 21 | /// Uses Vec<T> with a separate free list and generation tracking |
| 22 | #[derive(Debug)] |
| 23 | pub struct CompactArena<T> { |
| 24 | /// Direct storage without Option wrapper |
| 25 | storage: Vec<T>, |
| 26 | /// Free slot indices for reuse |
| 27 | free_list: Vec<usize>, |
| 28 | /// Generation counter for safety (optional) |
| 29 | generation: u32, |
| 30 | /// Track which slots are actually allocated |
| 31 | allocated_mask: Vec<bool>, |
| 32 | } |
| 33 | |
| 34 | impl<T> CompactArena<T> { |
| 35 | /// Create a new empty compact arena |
nothing calls this directly
no outgoing calls
no test coverage detected