In our previous episode, Martin Frb said: > >> the array), does not mean there is copy on write. > > So basically, if for a given size x, setlength(x,1) always reallocates, then > > it is COW, otherwise not :-)
That came out wrong wrong. Should've been for given x, setlength(p,x+1); p (after) is always not equal to p(before). > Not sure what you mean? I meant to say that if the implementation can increase the dyn array with 1 without reallocation, and it does nevertheless, it is COW not mere reallocation. But since when to reallocate is implementation dependent, that is a hard thing to prove. > > (and even if it does, one could still argue it is an implementation detail) > > > > But if you want to use the term, IMHO it would be: > "Dynamic arrays have no copy-on-write. But SetLength perform a > copy-on-write on dynamic arrays." ... depending on allocation, Setlength might reallocate and copy ... _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal