3 ms·
As far as I know, using `new` or not has nothing to really do if it goes onto the stack or not. That's simply a common implementation details. What its really
by vodik 11y ago
As far as I know, using `new` or not has nothing to really do if it goes onto the stack or not. That's simply a common implementation details.
What its really saying is if the lifetime is automatic or manual.
Maybe I'm confusing C with C++ or just outright confused, but to my understanding, nothing says that:
int foo[] = <massive amount of data>;
actually has to live on the stack.
- EpicEng 11y agoWell, in practice, it's both. Sure, stacks and heaps are an implementation detail, but they're pervasive. You simply can't write int x[10000][10000]; and expect it to not cause a stack overflow in any real world implementation. It's an implementation detail you absolutely need to be aware of.
- bmm6o 11y ago> nothing says that [...] actually has to live on the stack. This might be possible in theory but I've never seen it in practice.