From 5ed9db738f05bcc8a855e2ddd5f3ad243a22e0a8 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Mon, 16 Mar 2009 16:05:00 +0000 Subject: [PATCH] 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. --- rts/HeapStackCheck.cmm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); \ -- 1.7.10.4