Re: [fpc-devel] Feature request/discussion - SetLengthNoInit

2020-09-15 Thread RORDEN, CHRIS via fpc-devel
I think dynamic arrays are really elegant features of Pascal and a strong benefit versus C. However, when working with large projects one encounters situations where one wants more. control. I would advocate allowing developers to optionally use SetLengthNoInit and also allowing user to specify

Re: [fpc-devel] Feature request/discussion - SetLengthNoInit

2020-09-15 Thread RORDEN, CHRIS via fpc-devel
The dynamic arrays in Lazarus have so many terrific properties. Giving power users the ability to not initialize them would give clear performance benefits. This is useful in real world sitautions where one has long term arrays, but also can use transient arrays of the same type. Another feature

Re: [fpc-devel] Feature request/discussion - SetLengthNoInit

2020-09-15 Thread Ryan Joseph via fpc-devel
> On Sep 15, 2020, at 10:34 PM, J. Gareth Moreton via fpc-devel > wrote: > > I'm willing to settle with SetLength(array, len, ... len, NoInit: Boolean = > False), but of course it depends on the overall support for it, which isn't > looking too promising currently! > > I'd rather put the

Re: [fpc-devel] Feature request/discussion - SetLengthNoInit

2020-09-15 Thread J. Gareth Moreton via fpc-devel
You all make good points.  It's why I didn't suggest changing SetLength because of the well-defined and safe behaviour, and yes, the System unit is already crowded with intrinsics, and will become even more crowded once the naming format of the assembly intrinsics are finalised.  The optional p

Re: [fpc-devel] Feature request/discussion - SetLengthNoInit

2020-09-15 Thread Sven Barth via fpc-devel
J. Gareth Moreton via fpc-devel schrieb am Mo., 14. Sep. 2020, 19:00: > With all this in mind, would there be support for an intrinsic such as > "SetLengthNoInit" or "SetLengthNoClear" or some similar name that has > all the benefits of SetLength (especially the reference counting) but > doesn't