How does GC.addRange work?

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 22 05:56:11 PDT 2014


On 9/21/14 3:00 PM, Gary Willoughby wrote:
> On Saturday, 20 September 2014 at 23:08:08 UTC, ketmar via
> Digitalmars-d-learn wrote:
>> On Sat, 20 Sep 2014 22:21:13 +0000
>> Gary Willoughby via Digitalmars-d-learn
>> <digitalmars-d-learn at puremagic.com> wrote:
>>
>>> So zeroing values will inform the GC the reference has gone?
>> yes.
>
> Thanks, i just wanted to make it clear in my mind.

Just to be crystal clear, zeroing values in that range will make the GC 
able to collect the memory that those values previously pointed at. 
However, you have to remove the range in order for the GC to ignore that 
data. In other words, if you zero that memory, the GC will continue to 
scan those zeros until you GC.removeRange it.

-Steve


More information about the Digitalmars-d-learn mailing list