Am 15.02.2014 19:41, schrieb Michael Van Canneyt: > > That setlength behaves rather freakish for dynamic arrays, does not > mean we have copy-on-write.
setlength does not behave freaky but its behaviour is well designed. The reason why setlength does a deep copy is simple: multithreading. If setlength had no deep copy semantics, it would need locking of the whole array data, not only locked access to the ref. counter. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal