Fix the iteraction between bridge and major evacuation on a minor overflow major...
commit26f29ae24c2564f325b56dac5e28054264d2f2cf
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 10 Jan 2012 17:25:14 +0000 (10 15:25 -0200)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 10 Jan 2012 18:02:44 +0000 (10 16:02 -0200)
tree35f4a538cacdcd5754b768807a95e17b5b6c7c43
parent3468d9430fba3723c71cdfd596c2f59e711189d7
Fix the iteraction between bridge and major  evacuation on a minor overflow major collection.

* sgen-gc.c: The bridge code is split into 3 steps, one done when we collect finalizable objects,
one done before we restart the world and the last right after.

The first step can be executed twice if an overflow major collection happens. We handled this
situation by avoiding duplicates in the registration code.

This works fine except if a registered bridge object is moved by the second collection, which can
happen when defragmentation kicks in.

Instead of fixing those pointers, which is quite tricky, we move hash building to happen in the second
step and discard all elements on the registered bridge array before each collection.  Since all bridges
collected by the first collection will be collected again on the second, we can do it.
mono/metadata/sgen-bridge.c
mono/metadata/sgen-gc.c
mono/metadata/sgen-gc.h