logoalt Hacker News

fancyfredbot • yesterday at 8:42 PM • 1 reply • view on HN

Thanks!

I'm a bit confused about how you could decide the number of stacks at compile time. I can see you could see how many arrays are lexically in scope. However if the code puts one dynamic array inside another dynamic array I can get to an unbounded number of total stacks without ever needing more than two in lexical scope at once. Do you also add stacks at runtime? Like a stack of stacks?


Replies

Aardappel • yesterday at 8:57 PM

The top level arrays all are owned by a local variable. An array of arrays is just allocated to a single stack.

➕ show 1 reply