Generic const - a non-functional view

Simen Kjaeraas simen.kjaras at gmail.com
Thu Jun 26 10:05:44 PDT 2008


Me Here <p9e883002 at sneakemail.com> wrote:
> I *know* the above proves it, because I can monitor the memory usage and
> addresses.
> I used a very large string and the mutated a character in the middle of  
> it. If
> the original string was mutated, the memory consumption of the process  
> would
> have to (breifly) double. It does not.

Could not the garbage collector theoretically be intelligent enough to see
that there's only one reference to the string, and thus not do CoW?

-- Simen



More information about the Digitalmars-d mailing list