COW vs. in-place.

Reiner Pope reiner.pope at gmail.com
Thu Aug 3 00:03:31 PDT 2006


> Why not:
> 
>     str = toupper(str);     // in-place
>     str = toupper(str.dup); // COW

This is not copy on write. That is simply 'always copy', and this 
performs worse than COW (which in turn performs worse than in-place, if 
in-place is possible). Walter has also said earlier that, with COW, it 
should be the responsibility of the writer to ensure the copy, not the 
caller.



More information about the Digitalmars-d mailing list