[fpc-devel] Feature request/discussion - SetLengthNoInit

Sven Barth pascaldragon at googlemail.com
Tue Sep 15 11:11:29 CEST 2020

J. Gareth Moreton via fpc-devel <fpc-devel at lists.freepascal.org> 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 initialise new elements to zero? If I'm learning one thing, Free
> Pascal is finding a niche in some scientific applications, and speed can
> be essential sometimes.

I'm against adding support for this. Dynamic arrays have guaranteed
behavior. If users find that this behavior is not appropriate for their use
case then they should not use them (or as you already suggested,
preallocate them).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20200915/4c0354ee/attachment.htm>

More information about the fpc-devel mailing list