summaryrefslogtreecommitdiff
path: root/rts/parallel
diff options
context:
space:
mode:
authorAntoine Latter <aslatter@gmail.com>2010-01-01 18:33:46 +0000
committerAntoine Latter <aslatter@gmail.com>2010-01-01 18:33:46 +0000
commit17c8229adf9f268097e4c87053d940a918c3a26f (patch)
tree578661321f7a92f51f397ac5a0bf2e26a1683f5e /rts/parallel
parenta0e32f1151a9bc765527bd9ee48a54a27ce1750e (diff)
downloadhaskell-17c8229adf9f268097e4c87053d940a918c3a26f.tar.gz
FIX #38000 Store StgArrWords payload size in bytes
Diffstat (limited to 'rts/parallel')
-rw-r--r--rts/parallel/Pack.c14
-rw-r--r--rts/parallel/Parallel.c2
-rw-r--r--rts/parallel/ParallelDebug.c4
3 files changed, 10 insertions, 10 deletions
diff --git a/rts/parallel/Pack.c b/rts/parallel/Pack.c
index 43d309eaf2..fe64a75e1e 100644
--- a/rts/parallel/Pack.c
+++ b/rts/parallel/Pack.c
@@ -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; i<n; i++)
@@ -2817,7 +2817,7 @@ UnpackArray(StgWord ***bufptrP, StgClosure *graph)
ASSERT(info->type == 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; i<n; i++)
@@ -3928,7 +3928,7 @@ rtsPackBuffer *packBuffer;
/* ToDo: check whether this is really needed */
if (ip->type == 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);
}
diff --git a/rts/parallel/Parallel.c b/rts/parallel/Parallel.c
index 99a2bb221b..55c22c752a 100644
--- a/rts/parallel/Parallel.c
+++ b/rts/parallel/Parallel.c
@@ -1045,7 +1045,7 @@ get_closure_info(StgClosure* node, nat *size, nat *ptrs, nat *nonptrs,
/* ToDo: check whether this can be merged with the default case */
*size = arr_words_sizeW((StgArrWords *)node);
*ptrs = 0;
- *nonptrs = ((StgArrWords *)node)->words;
+ *nonptrs = arr_words_words(((StgArrWords *)node));
*vhs = *size - *ptrs - *nonptrs - sizeofW(StgHeader);
return info;
diff --git a/rts/parallel/ParallelDebug.c b/rts/parallel/ParallelDebug.c
index b357af6379..5616a9a945 100644
--- a/rts/parallel/ParallelDebug.c
+++ b/rts/parallel/ParallelDebug.c
@@ -1269,7 +1269,7 @@ PrintGraph_(StgClosure *p, int indent_level)
case ARR_WORDS:
/* an array of (non-mutable) words */
fprintf(stderr, "ARR_WORDS (%p) of %d non-ptrs (maybe a string?)\n",
- p, ((StgArrWords *)q)->words);
+ p, arr_words_words((StgArrWords *)q));
break;
case MUT_ARR_PTRS:
@@ -1626,7 +1626,7 @@ GraphFingerPrint_(StgClosure *p, char *finger_print)
case ARR_WORDS:
{
char str[6];
- sprintf(str,"%d",((StgArrWords*)p)->words);
+ sprintf(str,"%d",arr_words_words((StgArrWords*)p));
strcat(finger_print,str);
}
break;