X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FThreadPaused.c;h=3aa66edc191a858aef32056bb59860bada32b5b4;hb=d5a9ee0e98a76bca1b41bbc5252e851c88b3ff4c;hp=5b64f76ff29aeb8766b26c74e32a6c3f71c5d8f5;hpb=a1e3066e066f0f75da361f881b2f3198e0aada5f;p=ghc-hetmet.git diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c index 5b64f76..3aa66ed 100644 --- a/rts/ThreadPaused.c +++ b/rts/ThreadPaused.c @@ -50,7 +50,7 @@ stackSqueeze(StgTSO *tso, StgPtr bottom) current_gap_size = 0; gap = (struct stack_gap *) (tso->sp - sizeofW(StgUpdateFrame)); - while (frame < bottom) { + while (frame <= bottom) { info = get_ret_itbl((StgClosure *)frame); switch (info->i.type) { @@ -202,6 +202,11 @@ threadPaused(Capability *cap, StgTSO *tso) while (1) { // If we've already marked this frame, then stop here. if (frame->header.info == (StgInfoTable *)&stg_marked_upd_frame_info) { + if (prev_was_update_frame) { + words_to_squeeze += sizeofW(StgUpdateFrame); + weight += weight_pending; + weight_pending = 0; + } goto end; } @@ -305,7 +310,7 @@ end: // the number of words we have to shift down is less than the // number of stack words we squeeze away by doing so. if (RtsFlags.GcFlags.squeezeUpdFrames == rtsTrue && - weight < words_to_squeeze) { + ((weight <= 4 && words_to_squeeze > 0) || weight < words_to_squeeze)) { stackSqueeze(tso, (StgPtr)frame); } }