3 ms·
"Variable-length arrays, alone, would save a tremendous amount of time and energy" That is, until you overflow the stack with no way to know if that's going to
by jstanley 14y ago
"Variable-length arrays, alone, would save a tremendous amount of time and energy"
That is, until you overflow the stack with no way to know if that's going to happen and no way to recover if it does.
- Someone 14y agoFirstly, that can happen with fixed-length arrays or even without arrays, too. Secondly, I don't have access to the official standard, but it would surprise me if it required VLA's to be stack allocated. That would give implementers of the language too little leeway. In fact, I see no clear reason why the standard would mention the word 'stack' at all. A quick check of the candidate PDF of the standard seems to confirm that, but that's not the real standard, and it may be a shortcoming of the iOS PDF reader.