Commit d3c2d59b authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

RTS: avoid overflow on 32-bit arch (#18375)

We're now correctly computing allocated bytes on 32-bit arch, so we get
huge increases.

Metric Increase:
    haddock.Cabal
    haddock.base
    haddock.compiler
    space_leak_001
parent a788d4d1
Pipeline #21478 failed with stages
in 832 minutes and 46 seconds
......@@ -114,7 +114,7 @@ struct Capability_ {
// Total words allocated by this cap since rts start
// See Note [allocation accounting] in Storage.c
W_ total_allocated;
uint64_t total_allocated;
#if defined(THREADED_RTS)
// Worker Tasks waiting in the wings. Singly-linked.
......
......@@ -100,8 +100,8 @@ stg_gc_noregs
CLOSE_NURSERY();
Capability_total_allocated(MyCapability()) =
Capability_total_allocated(MyCapability()) +
BYTES_TO_WDS(bdescr_free(CurrentNursery) -
bdescr_start(CurrentNursery));
%zx64(BYTES_TO_WDS(bdescr_free(CurrentNursery) -
bdescr_start(CurrentNursery)));
CurrentNursery = bdescr_link(CurrentNursery);
bdescr_free(CurrentNursery) = bdescr_start(CurrentNursery);
OPEN_NURSERY();
......
......@@ -1455,10 +1455,10 @@ dirty_MVAR(StgRegTable *reg, StgClosure *p, StgClosure *old_val)
// program. Also emits events reporting the per-cap allocation
// totals.
//
StgWord
uint64_t
calcTotalAllocated (void)
{
W_ tot_alloc = 0;
uint64_t tot_alloc = 0;
W_ n;
for (n = 0; n < n_capabilities; n++) {
......
......@@ -94,8 +94,8 @@ INLINE_HEADER void newNurseryBlock (bdescr *bd) {
bd->free = bd->start;
}
void updateNurseriesStats (void);
StgWord calcTotalAllocated (void);
void updateNurseriesStats (void);
uint64_t calcTotalAllocated (void);
/* -----------------------------------------------------------------------------
Stats 'n' DEBUG stuff
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment