logoalt Hacker News

Aardappel • yesterday at 9:03 PM • 1 reply • view on HN

Only top level growable arrays get their own "stack", if you create an array of arrays it only uses one stack.

How you deal with the inner stack growing depends, ideally they don't grow (construction only), or you can make them fixed size, or with a capacity, or in the worst case, as a pool. The language has facilities for all of these.


Replies

amluto • yesterday at 10:36 PM

What’s the “pool” case? A function allocates a growable arena in normal heap or virtual memory?

➕ show 1 reply