John Colvin:

The problem is that the size isn't necessarily known.

The size is generally known only at run-time, that's the point.


I guess the compiler could put in a branch, but at that point you'd probably want to give the programmer control and have a way of making it explicit.

You don't forget to put branches added by the compiler, so it's safer.

Generally you prefer something that's guaranteed to be allocated on the stack when it's small and there's enough stack. An array allocation annotated with "scope", perhaps.

Bye,
bearophile

Reply via email to