>> 2) COW must survive garbage collection
>
> COW can in certain cases, *not* survive garbage collection, specifically
The simplest possible implementation of COW strings would be to let the
garbage collector 'undo' the COW nature i.e. make multiple copies of all
shared buffers. All I meant was "
> I made two assumptions for my test implementation of COW strings:
Wow, you already have a COW implementation? Great to hear!
> 1) we need to be able to share substrings as well as complete strings
> 2) COW must survive garbage collection
> Without these two, I believe the overhead probably outw