Re: Doubling up pointers

Jon Harrop <[email protected]> Fri, 16 Sep 2011 17:17:54 +0100
Newsgroups gmane.comp.programming.garbage-collection.general
Message-ID <[email protected]>
I'm guessing it might be quicker. Perhaps it is possible to run most of the=
 time without write barriers and, only when GC begins, shift mutators into =
a GC phase where they use write barriers and swap before swapping the meani=
ng of the pointers and traversing that snapshot of the heap (+ anything the=
 write barriers flagged as changed) before shifting them back once mark+swe=
ep has finished.

I like the idea of evading write barriers because they can be so costly in =
important circumstances, e.g. swapping strings in an array is 5x slower on =
.NET than swapping ints because of the write barrier and hash tables with s=
tring keys or values will often incur write barriers (and filling one is pa=
thological for generational GC).

Cheers,
Jon.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On B=
ehalf Of Richard Brooksby
Sent: 15 September 2011 13:51
To: Jon Harrop
Cc: [email protected]
Subject: Re: [gclist] Doubling up pointers

On 2011-09-14, at 18:09, Jon Harrop wrote:

> In the context of taking a snapshot of the topology of the heap, I'm
> wondering if anyone has considered or tried replacing each pointer with a
> pair of pointers and having the mutators work on the first/second of each
> pair while the GC traverses the second/first of each pair?

How would this be different from collecting a snapshot of the heap?  (I can=
 think of some things but I wonder if you could elaborate.)


Trayport Limited
Registered in England at 4th Floor Rose Court, 2 Southwark Bridge Road, Lon=
don SE1 9HS
Company registration no.2769279.