On Sun, 9 Feb 2014, Florian Klämpfl wrote:

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.

The documentation explicitly mentions that:

'Dynamic arrays are reference counted: assignment of one dynamic array-type
variable to another will let both variables point to the same array.
Contrary to ansistrings, an assignment to an element of one array will
be reflected in the other: there is no copy-on-write.'

But I have added a paragraph about the "reset ref. count" behaviour of 
setlength.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to