While I think I understand the difference between the Expand and the ExpandCreate mehods of TClonesArray, I can’t really understand the benefits of one respect to the other.
- Expand will just create the space in the TClonesArray internals for the pointers to the new elements but will not allocate the space for the elements themselves. The latters will be allocated e.g. on first access using operator
- ExpandCreate behaves like Expand, but it also allocates memory for the elements
Since in both scenarios the elements are allocated one by one then I guess that there is no major difference regarding the allocation efficiency and thus the speed, right? Also, in both approaches the elements are initialized calling the default constructor, so in the end also the content should be the same, right?