MAYBE_GC: initialise HpAlloc
authorSimon Marlow <simonmar@microsoft.com>
Wed, 30 Aug 2006 09:15:29 +0000 (09:15 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 30 Aug 2006 09:15:29 +0000 (09:15 +0000)
HpAlloc was not being set when returning to the scheduler via MAYBE_GC(),
which at the least was just wrong (the scheduler might allocate a large
block more than once), and at worst could lead to crashes if HpAlloc contains
garbage.

Fixes at least one threaded2 test on Windows.

includes/Cmm.h

index e494b60..3d3283e 100644 (file)
   if (bdescr_link(CurrentNursery) == NULL || CInt[alloc_blocks] >= CInt[alloc_blocks_lim]) {           \
        R9  = liveness;                                 \
         R10 = reentry;                                 \
+        HpAlloc = 0;                                   \
         jump stg_gc_gen_hp;                            \
    }