compiler support added for precise GC

Alex Rønne Petersen xtzgzorex at gmail.com
Mon Apr 16 09:35:33 PDT 2012


On 16-04-2012 18:32, Walter Bright wrote:
> On 4/15/2012 7:29 PM, Walter Bright wrote:
>> I realized after I posted this that the patterns:
>>
>> ptr .. int .. ptr .. int
>> ptr .. int .. ptr
>> ptr .. int .. ptr .. int .. int
>>
>> are the same as far as marking goes, and so should all generate the same
>> function/data.
>
> Another possibility is to just emit a bit mask:

This is, in fact, what most production GCs do (e.g. Mono's SGen). It's 
widely considered a good technique.

>
> 0 no pointers
> 101 ptr .. int .. ptr
> 1011 ptr .. ptr .. int .. ptr
>  >0xFFFF a pointer to a function that does the marking
>
> This has the advantage of almost never needing to resort to the indirect
> function call.

-- 
- Alex


More information about the Digitalmars-d mailing list