News for hackers. Stuff that matters.
Re:C++14 by cygx on Friday November 02, 2012 @12:00PM (#4733219)
> There is no real need for runtime sized arrays, as one could already use vectors [...] and allocate them on the stack

And how exactly would you do that? alloca() aside, there is no such thing as a stack allocator.

Re:C++14 by flebron on Friday November 02, 2012 @12:25PM (#4733359)
There's several projects that have seen the need to allocate variable length things on the stack, Chromium was one[1]. A quick googling sends me to [2] as well.

I haven't ever found myself in a situation where I _needed_ my stuff to be stack allocated, but then again I've never done really low level programming or embedded code, and I guess it could happen there.

[1] http://src.chromium.org/viewvc/chrome/trunk/src/base/stack_c...

[2] http://home.roadrunner.com/~hinnant/stack_alloc.html

Re:C++14 by cygx on Friday November 02, 2012 @01:58PM (#4733905)
These just allocate a fixed-sized stack buffer and overflow to the heap - no variable-length stack allocation happens.
Re:C++14 by flebron on Friday November 02, 2012 @02:38PM (#4734096)
Right, because alloca is the only thing (as far as I know) that can resize the stack. There is not going to be anything else that does the same thing. The best one can do is those stack allocators which overflow to heap, or an alloca-based stack allocator.

There's an interesting discussion[1] at comp.std.c++ about implementing VLAs in C++0x, and the issues with dynamic stack resizing.

[1] https://groups.google.com/forum/?fromgroups=#!topic/comp.std...