Skip to main content

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

AttributeTypeDescription
Array.data[MaybeUninit< RecursionKey >; ARRAY_SIZE]Fixed-size buffer of uninitialized recursion keys used for efficient stack tracking without heap allocation.
Array.lenusizeThe current number of active elements stored in the fixed-size array stack.
SetAHashSet< RecursionKey >A hash set used for tracking recursion keys when the stack depth exceeds the fixed array capacity.