From: Simon Marlow Date: Mon, 16 Mar 2009 16:05:00 +0000 (+0000) Subject: Retract Hp *before* checking for HpLim==0 X-Git-Tag: 2009-06-25~476 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=5ed9db738f05bcc8a855e2ddd5f3ad243a22e0a8;p=ghc-hetmet.git Retract Hp *before* checking for HpLim==0 Fixes heapprof001(prof_hp) following the recent HpLim patch, which depended on the lack of slop in the heap. --- diff --git a/rts/HeapStackCheck.cmm b/rts/HeapStackCheck.cmm index 10baca2..1533ae0 100644 --- a/rts/HeapStackCheck.cmm +++ b/rts/HeapStackCheck.cmm @@ -63,11 +63,11 @@ import LeaveCriticalSection; #define GC_GENERIC \ DEBUG_ONLY(foreign "C" heapCheckFail()); \ if (Hp > HpLim) { \ + Hp = Hp - HpAlloc/*in bytes*/; \ if (HpLim == 0) { \ R1 = ThreadYielding; \ goto sched; \ } \ - Hp = Hp - HpAlloc/*in bytes*/; \ if (HpAlloc <= BLOCK_SIZE \ && bdescr_link(CurrentNursery) != NULL) { \ CLOSE_NURSERY(); \