Would you extent Tlist. Or do it with an "expanding" contracting Array? I suppose it depends on if expanding the array means making a whole new array, and coping the old one.
But if you wanted to "Cap" the stack, an array would work.
OR, and I think this is the way to do it, would be to alloc some memory, and have a pointer to the "End of the stack", that you move up and down in your stack.
If you did it with ?debug compiler directives, you could bounds check in debug and not in release
But if you wanted to "Cap" the stack, an array would work.
OR, and I think this is the way to do it, would be to alloc some memory, and have a pointer to the "End of the stack", that you move up and down in your stack.
If you did it with ?debug compiler directives, you could bounds check in debug and not in release