X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FStorage.c;h=781234a72d3ee071fa9769cad4aa3b267b309ef5;hb=5fb52815fa7aef4a4793eb58a909bd5465b77bb4;hp=d9c7f8627829f79927fe9c4eeed8b88584083cf5;hpb=214b3663d5d7598c13643f9221e43d5a7735b47f;p=ghc-hetmet.git diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index d9c7f86..781234a 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -49,8 +49,6 @@ generation *generations = NULL; /* all the generations */ generation *g0 = NULL; /* generation 0, for convenience */ generation *oldest_gen = NULL; /* oldest generation, for convenience */ -ullong total_allocated = 0; /* total memory allocated during run */ - nursery *nurseries = NULL; /* array of nurseries, size == n_capabilities */ #ifdef THREADED_RTS @@ -79,6 +77,7 @@ initGeneration (generation *gen, int g) gen->n_old_blocks = 0; gen->large_objects = NULL; gen->n_large_blocks = 0; + gen->n_new_large_blocks = 0; gen->mut_list = allocBlock(); gen->scavenged_large_objects = NULL; gen->n_scavenged_large_blocks = 0; @@ -567,6 +566,7 @@ allocate (Capability *cap, lnat n) bd = allocGroup(req_blocks); dbl_link_onto(bd, &g0->large_objects); g0->n_large_blocks += bd->blocks; // might be larger than req_blocks + g0->n_new_large_blocks += bd->blocks; RELEASE_SM_LOCK; initBdescr(bd, g0, g0); bd->flags = BF_LARGE; @@ -666,6 +666,7 @@ allocatePinned (Capability *cap, lnat n) cap->pinned_object_block = bd = allocBlock(); dbl_link_onto(bd, &g0->large_objects); g0->n_large_blocks++; + g0->n_new_large_blocks++; RELEASE_SM_LOCK; initBdescr(bd, g0, g0); bd->flags = BF_PINNED | BF_LARGE; @@ -784,7 +785,8 @@ calcAllocated( void ) } } - total_allocated += allocated; + allocated += g0->n_new_large_blocks * BLOCK_SIZE_W; + return allocated; }