summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorTomas Carnecky <tomas.carnecky@gmail.com>2016-05-08 14:44:07 +0200
committerBen Gamari <ben@smart-cactus.org>2016-05-10 08:40:50 +0200
commit260a5648c299636a94b12b9b97bf9743b0a1496d (patch)
tree2de1ffe579d1558d4352e496cf2e53b907e954d1 /rts
parentdd3e84701db7d05a6664aa5826732da3ee8ce265 (diff)
downloadhaskell-260a5648c299636a94b12b9b97bf9743b0a1496d.tar.gz
Use stdint types for Stg{Word,Int}{8,16,32,64}
We can't define Stg{Int,Word} in terms of {,u}intptr_t because STG depends on them being the exact same size as void*, and {,u}intptr_t does not make that guarantee. Furthermore, we also need to define StgHalf{Int,Word}, so the preprocessor if needs to stay. But we can at least keep it in a single place instead of repeating it in various files. Also define STG_{INT,WORD}{8,16,32,64}_{MIN,MAX} and use it in HsFFI.h, further reducing the need for CPP in other files. Reviewers: austin, bgamari, simonmar, hvr, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2182
Diffstat (limited to 'rts')
-rw-r--r--rts/ProfHeap.c2
-rw-r--r--rts/Stats.c6
-rw-r--r--rts/sm/Sanity.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index 58d66eb724..def490d0b1 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -829,7 +829,7 @@ dumpCensus( Census *census )
}
#endif
- fprintf(hp_file, "\t%" FMT_SizeT "\n", (W_)count * sizeof(W_));
+ fprintf(hp_file, "\t%" FMT_Word "\n", (W_)count * sizeof(W_));
}
printSample(rtsFalse, census->time);
diff --git a/rts/Stats.c b/rts/Stats.c
index 64a371a9d6..cf426ca0d3 100644
--- a/rts/Stats.c
+++ b/rts/Stats.c
@@ -331,7 +331,7 @@ stat_endGC (Capability *cap, gc_thread *gct,
if (RtsFlags.GcFlags.giveStats == VERBOSE_GC_STATS) {
W_ faults = getPageFaults();
- statsPrintf("%9" FMT_SizeT " %9" FMT_SizeT " %9" FMT_SizeT,
+ statsPrintf("%9" FMT_Word " %9" FMT_Word " %9" FMT_Word,
alloc*sizeof(W_), copied*sizeof(W_),
live*sizeof(W_));
statsPrintf(" %6.3f %6.3f %8.3f %8.3f %4" FMT_Word " %4" FMT_Word " (Gen: %2d)\n",
@@ -560,7 +560,7 @@ stat_exit (void)
if (tot_elapsed == 0.0) tot_elapsed = 1;
if (RtsFlags.GcFlags.giveStats >= VERBOSE_GC_STATS) {
- statsPrintf("%9" FMT_SizeT " %9.9s %9.9s", (W_)alloc*sizeof(W_), "", "");
+ statsPrintf("%9" FMT_Word " %9.9s %9.9s", (W_)alloc*sizeof(W_), "", "");
statsPrintf(" %6.3f %6.3f\n\n", 0.0, 0.0);
}
@@ -836,7 +836,7 @@ statDescribeGens(void)
tot_slop += gen_slop;
}
debugBelch("----------------------------------------------------------\n");
- debugBelch("%41s%8" FMT_SizeT " %8" FMT_SizeT "\n",
+ debugBelch("%41s%8" FMT_Word " %8" FMT_Word "\n",
"",tot_live*sizeof(W_),tot_slop*sizeof(W_));
debugBelch("----------------------------------------------------------\n");
debugBelch("\n");
diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c
index d1ed7db977..794bce7491 100644
--- a/rts/sm/Sanity.c
+++ b/rts/sm/Sanity.c
@@ -821,7 +821,7 @@ void findSlop(bdescr *bd)
for (; bd != NULL; bd = bd->link) {
slop = (bd->blocks * BLOCK_SIZE_W) - (bd->free - bd->start);
if (slop > (1024/sizeof(W_))) {
- debugBelch("block at %p (bdescr %p) has %" FMT_SizeT "KB slop\n",
+ debugBelch("block at %p (bdescr %p) has %" FMT_Word "KB slop\n",
bd->start, bd, slop / (1024/sizeof(W_)));
}
}