Am 09.02.2014 18:41, schrieb Jürgen Hestermann: > So it seems there is a copy-on-write *but* only when using SetLength.
No. There is no COW, only ref. counting. SetLength just forces an unique instance of the array if needed. > What a very consistent design! There is a very good reason for this design: speed. COW would mean that at every write to a dyn. array element, ref. count must be checked. This would render dyn. arrays useless for a lot of applications due to poor speed. So dyn. arrays with COW simply make no sense. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal