X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FPrimOps.hc;h=48f5cacfb99772152644dc6abeb787973bb72a77;hb=a814590c794226b34c0c9aff4138b0e7722ddab5;hp=9b3f3a43f2109b2ddc562916f13b19123ca07689;hpb=85aa72b9dc6803685595936c61f3cab6faab815a;p=ghc-hetmet.git diff --git a/ghc/rts/PrimOps.hc b/ghc/rts/PrimOps.hc index 9b3f3a4..48f5cac 100644 --- a/ghc/rts/PrimOps.hc +++ b/ghc/rts/PrimOps.hc @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: PrimOps.hc,v 1.113 2003/09/21 22:20:55 wolfgang Exp $ + * $Id: PrimOps.hc,v 1.115 2003/10/22 15:01:00 simonmar Exp $ * * (c) The GHC Team, 1998-2002 * @@ -402,7 +402,22 @@ FN_(unsafeThawArrayzh_fast) { FB_ SET_INFO((StgClosure *)R1.cl,&stg_MUT_ARR_PTRS_info); - recordMutable((StgMutClosure*)R1.cl); + + // SUBTLETY TO DO WITH THE OLD GEN MUTABLE LIST + // + // A MUT_ARR_PTRS lives on the mutable list, but a MUT_ARR_PTRS_FROZEN + // normally doesn't. However, when we freeze a MUT_ARR_PTRS, we leave + // it on the mutable list for the GC to remove (removing something from + // the mutable list is not easy, because the mut_list is only singly-linked). + // + // So, when we thaw a MUT_ARR_PTRS_FROZEN, we must cope with two cases: + // either it is on a mut_list, or it isn't. We adopt the convention that + // the mut_link field is NULL if it isn't on a mut_list, and the GC + // maintains this invariant. + // + if (((StgMutArrPtrs *)R1.cl)->mut_link == NULL) { + recordMutable((StgMutClosure*)R1.cl); + } TICK_RET_UNBOXED_TUP(1); RET_P(R1.p); @@ -1053,20 +1068,6 @@ FN_(forkzh_fast) FE_ } -FN_(forkProcesszh_fast) -{ - pid_t pid; - - FB_ - /* args: none */ - /* result: Pid */ - - R1.i = RET_STGCALL1(StgInt, forkProcess, CurrentTSO); - - RET_N(R1.i); - FE_ -} - FN_(yieldzh_fast) { FB_