[project @ 2002-07-10 09:28:54 by simonmar]
authorsimonmar <unknown>
Wed, 10 Jul 2002 09:28:56 +0000 (09:28 +0000)
committersimonmar <unknown>
Wed, 10 Jul 2002 09:28:56 +0000 (09:28 +0000)
commitf477a85c5ba20c12e6f229e5b870fddc7e8bacfd
treea932ee7739b4ddb951b8cb1c2dce919ec8dc64cf
parentea92792175a57383168dd62b9fbd3981a1d7c647
[project @ 2002-07-10 09:28:54 by simonmar]
Fix a GC bug.  In a "large block", only the block descriptor for the
head of the block has the fields step, gen_no and flags set.  So
whenever we want one of these fields in the descriptor for a random
object anywhere in the large block, we have to check whether it is in
the head block, and if not follow the link to the head block
descriptor.

evacuate() was doing this correctly, but isAlive() wasn't (and
goodness knows what other places are broken in this way - I identified
several other possible cases of the same bug).

So to try to make things more robust, when we allocate a large block
we now initialise the step, gen_no, and flags fields in the descriptor
for *every* sub-block, not just the first one.  Now, as long as you
only want one of these fields from the descriptor, there's no need to
try to find the block head.  evacuate() gets minutely faster, and
hopefully multiple obscure bugs are fixed by this.
ghc/rts/GC.c
ghc/rts/Schedule.c