RecursionStack
This class provides a mechanism for tracking recursion keys to prevent infinite loops or redundant processing during recursive operations. It supports two storage strategies: a fixed-size array for small-scale recursion and a hash set for handling larger or more complex recursion depths.
Attributes
| Attribute | Type | Description |
|---|---|---|
| Array.data | [MaybeUninit< RecursionKey >; ARRAY_SIZE] | Fixed-size buffer of uninitialized recursion keys used for efficient stack tracking without heap allocation. |
| Array.len | usize | The current number of active elements stored in the fixed-size array stack. |
| Set | AHashSet< RecursionKey > | A hash set used for tracking recursion keys when the stack depth exceeds the fixed array capacity. |