// allocate() - this includes many of the primops.
#define MAYBE_GC(liveness,reentry) \
if (bdescr_link(CurrentNursery) == NULL || \
- generation_n_large_blocks(W_[g0]) >= CInt[alloc_blocks_lim]) { \
+ generation_n_new_large_blocks(W_[g0]) >= CInt[alloc_blocks_lim]) { \
R9 = liveness; \
R10 = reentry; \
HpAlloc = 0; \
struct_size(generation);
struct_field(generation, mut_list);
- struct_field(generation, n_large_blocks);
+ struct_field(generation, n_new_large_blocks);
struct_size(CostCentreStack);
struct_field(CostCentreStack, ccsID);
bdescr * large_objects; // large objects (doubly linked)
unsigned int n_large_blocks; // no. of blocks used by large objs
+ unsigned int n_new_large_blocks; // count freshly allocated large objects
unsigned int max_blocks; // max blocks
bdescr *mut_list; // mut objects in this gen (not G0)
-
+
StgTSO * threads; // threads in this gen
// linked via global_link
struct generation_ *to; // destination gen for live objects
freeChain(gen->large_objects);
gen->large_objects = gen->scavenged_large_objects;
gen->n_large_blocks = gen->n_scavenged_large_blocks;
+ gen->n_new_large_blocks = 0;
ASSERT(countBlocks(gen->large_objects) == gen->n_large_blocks);
}
else // for generations > N
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;
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;
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;
}
}
+ allocated += g0->n_new_large_blocks * BLOCK_SIZE_W;
+
total_allocated += allocated;
return allocated;
}