Google Chrome and process-based design

Christopher Wright dhasenan at gmail.com
Fri Sep 5 16:25:33 PDT 2008


Fawzi Mohamed wrote:
> On 2008-09-05 03:06:24 +0200, Christopher Wright <dhasenan at gmail.com> said:
>> A major benefit of a precise GC is that you can turn it into a moving 
>> GC. Without a precise GC, you might change some random sequences of 
>> bytes to something else because it looks like a pointer to something 
>> you moved; not so with a precise GC.
> 
> well as long as you have unions, then you have to be *very* careful 
> about not moving them.
> In safe D this is not an issue.
> 
> Fawzi
> 

Ach, bugger the unions.

Now you need two bits per word: one for whether it contains pointers and 
one for whether it pins anything it points to, assuming it's a pointer. 
Unions containing pointers (punions) would be pinning pointers, and you 
could probably use some sort of pragma to indicate that a pointer should 
pin whatever it points to.

In the presence of a punion, a garbage collector would be conservative. 
Otherwise it could be precise.



More information about the Digitalmars-d mailing list