3 ms·
> Well, if you're gonna nitpick... :-) > A garbage-collected language wouldn't let you allocate such items on the stack in the first place. I get your point,
by zeroxfe 7y ago
> Well, if you're gonna nitpick...
:-)
> A garbage-collected language wouldn't let you allocate such items on the stack in the first place.
I get your point, but I don't think this is entirely true.
When people think of call stacks in the general sense, there's a major distinction between CPU stacks and managed stacks.
For example in both Java and Go, stack allocations are determined at compile time, and heap allocations at runtime. (Obv, stacks here are not actual CPU stacks, just managed memory stacks depending on the implementation.)