Generic const - a non-functional view

Bill Baxter dnewsgroup at billbaxter.com
Thu Jun 26 10:21:08 PDT 2008


Simen Kjaeraas wrote:
> 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

Right.  That's what I was thinking too.  But Steven's example with 
memory info rules out that possibility.

--bb



More information about the Digitalmars-d mailing list