diff options
author | Simon Marlow <marlowsd@gmail.com> | 2010-12-21 15:29:56 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2010-12-21 15:29:56 +0000 |
commit | db0c13a482893243cc829bbc253862e65f437cbe (patch) | |
tree | 96e3977a77b92f102c03518d826368cec5cd1229 /includes | |
parent | 1d7a3cf332532b1f9d798b44e76c4be6f0c74dcf (diff) | |
download | haskell-db0c13a482893243cc829bbc253862e65f437cbe.tar.gz |
Count allocations more accurately
The allocation stats (+RTS -s etc.) used to count the slop at the end
of each nursery block (except the last) as allocated space, now we
count the allocated words accurately. This should make allocation
figures more predictable, too.
This has the side effect of reducing the apparent allocations by a
small amount (~1%), so remember to take this into account when looking
at nofib results.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Cmm.h | 2 | ||||
-rw-r--r-- | includes/mkDerivedConstants.c | 2 | ||||
-rw-r--r-- | includes/rts/storage/GC.h | 5 | ||||
-rw-r--r-- | includes/stg/MiscClosures.h | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h index 6abe760be5..0ba14fbff6 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -383,7 +383,7 @@ // allocate() - this includes many of the primops. #define MAYBE_GC(liveness,reentry) \ if (bdescr_link(CurrentNursery) == NULL || \ - generation_n_new_large_blocks(W_[g0]) >= CInt[alloc_blocks_lim]) { \ + generation_n_new_large_words(W_[g0]) >= CLong[large_alloc_lim]) { \ R9 = liveness; \ R10 = reentry; \ HpAlloc = 0; \ diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c index 0ed7ec67da..d00e428394 100644 --- a/includes/mkDerivedConstants.c +++ b/includes/mkDerivedConstants.c @@ -246,7 +246,7 @@ main(int argc, char *argv[]) struct_size(generation); struct_field(generation, mut_list); - struct_field(generation, n_new_large_blocks); + struct_field(generation, n_new_large_words); struct_size(CostCentreStack); struct_field(CostCentreStack, ccsID); diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h index 9616d72d51..5eadd2dadc 100644 --- a/includes/rts/storage/GC.h +++ b/includes/rts/storage/GC.h @@ -67,7 +67,8 @@ typedef struct generation_ { 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 long n_new_large_words; // words of new large objects + // (for allocation stats) unsigned int max_blocks; // max blocks bdescr *mut_list; // mut objects in this gen (not G0) @@ -154,7 +155,7 @@ void * allocateExec(unsigned int len, void **exec_addr); void freeExec (void *p); // Used by GC checks in external .cmm code: -extern nat alloc_blocks_lim; +extern nat large_alloc_lim; /* ----------------------------------------------------------------------------- Performing Garbage Collection diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index c52a3c9702..e6cfc47bfa 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -474,7 +474,7 @@ extern StgWord stg_stack_save_entries[]; // Storage.c extern unsigned int RTS_VAR(g0); -extern unsigned int RTS_VAR(alloc_blocks_lim); +extern unsigned int RTS_VAR(large_alloc_lim); extern StgWord RTS_VAR(weak_ptr_list); extern StgWord RTS_VAR(atomic_modify_mutvar_mutex); |