Hacker News new | past | comments | ask | show | jobs | submit
A stack can grow arbitrarily deep (in practice, assuming 64-bit address space), but it grows only in one dimension. However, you can also have arbitrarily many stacks, so you can have a separate stack for every single thing that can grow in size in your program (by statically analyzing what variables hold data structures that could grow, and how many stacks at most you will need at the peak when program runs).