summaryrefslogtreecommitdiff
path: root/rts/sm/Storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/sm/Storage.c')
-rw-r--r--rts/sm/Storage.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index 1345705046..5bdaeee443 100644
--- a/rts/sm/Storage.c
+++ b/rts/sm/Storage.c
@@ -235,7 +235,7 @@ void storageAddCapabilities (nat from, nat to)
void
exitStorage (void)
{
- lnat allocated = updateNurseriesStats();
+ W_ allocated = updateNurseriesStats();
stat_exit(allocated);
}
@@ -504,15 +504,15 @@ allocNurseries (nat from, nat to)
assignNurseriesToCapabilities(from, to);
}
-lnat
+W_
clearNursery (Capability *cap)
{
bdescr *bd;
- lnat allocated = 0;
+ W_ allocated = 0;
for (bd = nurseries[cap->no].blocks; bd; bd = bd->link) {
- allocated += (lnat)(bd->free - bd->start);
- cap->total_allocated += (lnat)(bd->free - bd->start);
+ allocated += (W_)(bd->free - bd->start);
+ cap->total_allocated += (W_)(bd->free - bd->start);
bd->free = bd->start;
ASSERT(bd->gen_no == 0);
ASSERT(bd->gen == g0);
@@ -528,11 +528,11 @@ resetNurseries (void)
assignNurseriesToCapabilities(0, n_capabilities);
}
-lnat
+W_
countNurseryBlocks (void)
{
nat i;
- lnat blocks = 0;
+ W_ blocks = 0;
for (i = 0; i < n_capabilities; i++) {
blocks += nurseries[i].n_blocks;
@@ -633,7 +633,7 @@ move_STACK (StgStack *src, StgStack *dest)
-------------------------------------------------------------------------- */
StgPtr
-allocate (Capability *cap, lnat n)
+allocate (Capability *cap, W_ n)
{
bdescr *bd;
StgPtr p;
@@ -642,7 +642,7 @@ allocate (Capability *cap, lnat n)
CCS_ALLOC(cap->r.rCCCS,n);
if (n >= LARGE_OBJECT_THRESHOLD/sizeof(W_)) {
- lnat req_blocks = (lnat)BLOCK_ROUND_UP(n*sizeof(W_)) / BLOCK_SIZE;
+ W_ req_blocks = (W_)BLOCK_ROUND_UP(n*sizeof(W_)) / BLOCK_SIZE;
// Attempting to allocate an object larger than maxHeapSize
// should definitely be disallowed. (bug #1791)
@@ -740,7 +740,7 @@ allocate (Capability *cap, lnat n)
------------------------------------------------------------------------- */
StgPtr
-allocatePinned (Capability *cap, lnat n)
+allocatePinned (Capability *cap, W_ n)
{
StgPtr p;
bdescr *bd;
@@ -920,10 +920,10 @@ dirty_MVAR(StgRegTable *reg, StgClosure *p)
* need this function for the final stats when the RTS is shutting down.
* -------------------------------------------------------------------------- */
-lnat
+W_
updateNurseriesStats (void)
{
- lnat allocated = 0;
+ W_ allocated = 0;
nat i;
for (i = 0; i < n_capabilities; i++) {
@@ -935,15 +935,15 @@ updateNurseriesStats (void)
return allocated;
}
-lnat
+W_
countLargeAllocated (void)
{
return g0->n_new_large_words;
}
-lnat countOccupied (bdescr *bd)
+W_ countOccupied (bdescr *bd)
{
- lnat words;
+ W_ words;
words = 0;
for (; bd != NULL; bd = bd->link) {
@@ -953,19 +953,19 @@ lnat countOccupied (bdescr *bd)
return words;
}
-lnat genLiveWords (generation *gen)
+W_ genLiveWords (generation *gen)
{
return gen->n_words + countOccupied(gen->large_objects);
}
-lnat genLiveBlocks (generation *gen)
+W_ genLiveBlocks (generation *gen)
{
return gen->n_blocks + gen->n_large_blocks;
}
-lnat gcThreadLiveWords (nat i, nat g)
+W_ gcThreadLiveWords (nat i, nat g)
{
- lnat words;
+ W_ words;
words = countOccupied(gc_threads[i]->gens[g].todo_bd);
words += countOccupied(gc_threads[i]->gens[g].part_list);
@@ -974,9 +974,9 @@ lnat gcThreadLiveWords (nat i, nat g)
return words;
}
-lnat gcThreadLiveBlocks (nat i, nat g)
+W_ gcThreadLiveBlocks (nat i, nat g)
{
- lnat blocks;
+ W_ blocks;
blocks = countBlocks(gc_threads[i]->gens[g].todo_bd);
blocks += gc_threads[i]->gens[g].n_part_blocks;
@@ -987,10 +987,10 @@ lnat gcThreadLiveBlocks (nat i, nat g)
// Return an accurate count of the live data in the heap, excluding
// generation 0.
-lnat calcLiveWords (void)
+W_ calcLiveWords (void)
{
nat g;
- lnat live;
+ W_ live;
live = 0;
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
@@ -999,10 +999,10 @@ lnat calcLiveWords (void)
return live;
}
-lnat calcLiveBlocks (void)
+W_ calcLiveBlocks (void)
{
nat g;
- lnat live;
+ W_ live;
live = 0;
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
@@ -1021,10 +1021,10 @@ lnat calcLiveBlocks (void)
* that will be collected next time will therefore need twice as many
* blocks since all the data will be copied.
*/
-extern lnat
-calcNeeded (rtsBool force_major, lnat *blocks_needed)
+extern W_
+calcNeeded (rtsBool force_major, memcount *blocks_needed)
{
- lnat needed = 0, blocks;
+ W_ needed = 0, blocks;
nat g, N;
generation *gen;
@@ -1137,7 +1137,7 @@ void *allocateExec (nat bytes, void **exec_ret)
if (exec_block == NULL ||
exec_block->free + n + 1 > exec_block->start + BLOCK_SIZE_W) {
bdescr *bd;
- lnat pagesize = getPageSize();
+ W_ pagesize = getPageSize();
bd = allocGroup(stg_max(1, pagesize / BLOCK_SIZE));
debugTrace(DEBUG_gc, "allocate exec block %p", bd->start);
bd->gen_no = 0;