Precise GC

Alex Rønne Petersen xtzgzorex at gmail.com
Sun Apr 8 05:03:05 PDT 2012


On 08-04-2012 12:07, Rainer Schuetze wrote:
>
>
> On 4/8/2012 11:21 AM, Timon Gehr wrote:
>> On 04/08/2012 10:45 AM, Timon Gehr wrote:
>>> That actually sounds like a pretty awesome idea.
>>
>> I understand that the stack will still have to be scanned
>> conservatively, but how does the scheme deal with closures?
>
> I guess the compiler should generate an (anonymous) struct type
> corresponding to the closure data layout. There probably has to be a
> template for compiler generated structs or classes anyway.
>
> This new type could also be used as the type of the context pointer, so
> a debugger could display the closure variables.
>

This sounds sensible to me. No reason closure marking can't be precise 
if the compiler just emits the relevant type info (pretty much any other 
compiler with closures does this; see C#, F#, etc).

-- 
- Alex


More information about the Digitalmars-d mailing list