Joseph Rushton Wakeling:

So it's bizarre that there is a performance difference here.

Bizarre findings deserve more experiments and studies :-)


Incidentally, this was why I felt safe using uninitializedArray for arrays of e.g. long, size_t, etc., because the only difference at the end of the function could be whether the values contained in the array have been set or not. As I do ensure that any array entry used also has its value set, it should be OK.

You also have arrays of T. Someday T could be something with indirections :-) So minimallyInitializedArray is safer regarding future changes in your code.

Bye,
bearophile

Reply via email to