Apparent problem with GC not collecting on Windows

Dmitry Olshansky dmitry.olsh at gmail.com
Sat Dec 1 04:55:09 PST 2012


12/1/2012 2:53 PM, thedeemon пишет:
> On Friday, 30 November 2012 at 18:46:08 UTC, Dmitry Olshansky wrote:
>
>> I'd just throw in that we have a (almost) precise GC that is used by
>> at least one large project (the VisualD apparently). Though there were
>> some problems with it. Anyway I'd expect to see it in upstream by
>> 2.062 at least. It should help the cases like this tremendously.
>
> I expect it wouldn't help in this particular case because stack scanning
> is still conservative there (correct me if I'm wrong), and here we've
> got some stack value looking like a pointer to the array.
>

It should help because:
1) Each allocation happens in a new stack frame thus the pointer is 
overwritten each time.
2) Precise heap scanning helps this case because it greatly reduces the 
amount of false pointers (note it's not the stack variables that hold 
these allocations in place)

It doesn't guarantee that it will collect all of these chunks but number 
of false pointers that could point to them is far lower and the chance 
of being collected is that much higher.

The stack is typically small, unlike the heap.

-- 
Dmitry Olshansky


More information about the Digitalmars-d-learn mailing list