X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fparallel%2FPack.c;h=fe64a75e1e37d81255a612f9b094b35bdf9e97a3;hb=e5c3b478b3cd1707cf122833822f44b2ac09b8e9;hp=e8653f63031547f3d10b447459d3905c5c0efa73;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/rts/parallel/Pack.c b/rts/parallel/Pack.c index e8653f6..fe64a75 100644 --- a/rts/parallel/Pack.c +++ b/rts/parallel/Pack.c @@ -1,5 +1,5 @@ /* - Time-stamp: + Time-stamp: <2009-12-02 12:26:34 simonmar> Graph packing and unpacking code for sending it to another processor and retrieving the original graph structure from the packet. @@ -50,7 +50,7 @@ #include "GranSimRts.h" #include "ParallelRts.h" # if defined(DEBUG) -# include "Sanity.h" +# include "sm/Sanity.h" # include "Printer.h" # include "ParallelDebug.h" # endif @@ -1278,7 +1278,7 @@ PackArray(StgClosure *closure) ASSERT(info->type == ARR_WORDS || info->type == MUT_ARR_PTRS || info->type == MUT_ARR_PTRS_FROZEN || info->type == MUT_VAR); - n = ((StgArrWords *)closure)->words; + n = arr_words_words(((StgArrWords *)closure)); // this includes the header!: arr_words_sizeW(stgCast(StgArrWords*,q)); IF_PAR_DEBUG(pack, @@ -1299,7 +1299,7 @@ PackArray(StgClosure *closure) if (RtsFlags.ParFlags.ParStats.Global && RtsFlags.GcFlags.giveStats > NO_GC_STATS) { globalParStats.tot_arrs++; - globalParStats.tot_arr_size += ((StgArrWords *)closure)->words; + globalParStats.tot_arr_size += arr_words_words(((StgArrWords *)closure)); } /* record offset of the closure and allocate a GA */ @@ -1313,7 +1313,7 @@ PackArray(StgClosure *closure) /* Pack the header (2 words: info ptr and the number of words to follow) */ Pack((StgWord)*(StgPtr)closure); - Pack(((StgArrWords *)closure)->words); + Pack(arr_words_words(((StgArrWords *)closure))); /* pack the payload of the closure (all non-ptrs) */ for (i=0; itype == ARR_WORDS || info->type == MUT_ARR_PTRS || info->type == MUT_ARR_PTRS_FROZEN || info->type == MUT_VAR)); - n = ((StgArrWords *)bufptr)->words; + n = arr_words_words(((StgArrWords *)bufptr)); // this includes the header!: arr_words_sizeW(stgCast(StgArrWords*,q)); IF_PAR_DEBUG(pack, @@ -2834,7 +2834,7 @@ UnpackArray(StgWord ***bufptrP, StgClosure *graph) /* Unpack the header (2 words: info ptr and the number of words to follow) */ ((StgArrWords *)graph)->header.info = (StgInfoTable*)*bufptr++; // assumes _HS==1; yuck! - ((StgArrWords *)graph)->words = (StgWord)*bufptr++; + ((StgArrWords *)graph)->bytes = ((StgWord)*bufptr++) * sizeof(StgWord); /* unpack the payload of the closure (all non-ptrs) */ for (i=0; itype == ARR_WORDS) { ptrs = vhs = 0; - nonptrs = ((StgArrWords *)bufptr)->words; + nonptrs = arr_words_words(((StgArrWords *)bufptr)); size = arr_words_sizeW((StgArrWords *)bufptr); } @@ -4087,7 +4087,7 @@ rtsPackBuffer *packBuffer; /* ToDo: check whether this is really needed */ if (ip->type == ARR_WORDS) { ptrs = vhs = 0; - nonptrs = ((StgArrWords *)bufptr)->words+1; // payload+words + nonptrs = arr_words_words(((StgArrWords *)bufptr))+1; // payload+words size = arr_words_sizeW((StgArrWords *)bufptr); ASSERT(size==_HS+vhs+nonptrs); }