> So I've been wondering about variable length arrays from c99 for a while > now. They seem to me like a good way to avoid lots of trivial calls to > malloc/free at least for smaller arrays that aren't going to blow up the > stack. That said I don't see them being used. > > The promise of them seems to be 'easy', dynamic, stack allocated memory and ^^^^^
Most uses of variable length array in the kernel (and a significant part in userland) needs allocated data to outlive the routine they are allocated by. This rules out stack allocation.