summaryrefslogtreecommitdiff
path: root/rts/STM.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-04-11 14:48:49 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-04-11 14:49:12 +0100
commit1fb38442d3a55ac92795aa6c5ed4df82011df724 (patch)
tree3e4aa00f970fb58b4f7b6bb27f16eb9d8b7dbad2 /rts/STM.c
parent7bf5bf37e7f4f140c883016e9da50106535d2a94 (diff)
downloadhaskell-1fb38442d3a55ac92795aa6c5ed4df82011df724.tar.gz
Refactoring and tidy up
This is a port of some of the changes from my private local-GC branch (which is still in darcs, I haven't converted it to git yet). There are a couple of small functional differences in the GC stats: first, per-thread GC timings should now be more accurate, and secondly we now report average and maximum pause times. e.g. from minimax +RTS -N8 -s: Tot time (elapsed) Avg pause Max pause Gen 0 2755 colls, 2754 par 13.16s 0.93s 0.0003s 0.0150s Gen 1 769 colls, 769 par 3.71s 0.26s 0.0003s 0.0059s
Diffstat (limited to 'rts/STM.c')
-rw-r--r--rts/STM.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/rts/STM.c b/rts/STM.c
index 3de42e2090..e8d3fc0e0b 100644
--- a/rts/STM.c
+++ b/rts/STM.c
@@ -879,17 +879,12 @@ static StgBool check_read_only(StgTRecHeader *trec STG_UNUSED) {
/************************************************************************/
-void stmPreGCHook() {
- nat i;
-
+void stmPreGCHook (Capability *cap) {
lock_stm(NO_TREC);
TRACE("stmPreGCHook");
- for (i = 0; i < n_capabilities; i ++) {
- Capability *cap = &capabilities[i];
- cap -> free_tvar_watch_queues = END_STM_WATCH_QUEUE;
- cap -> free_trec_chunks = END_STM_CHUNK_LIST;
- cap -> free_trec_headers = NO_TREC;
- }
+ cap->free_tvar_watch_queues = END_STM_WATCH_QUEUE;
+ cap->free_trec_chunks = END_STM_CHUNK_LIST;
+ cap->free_trec_headers = NO_TREC;
unlock_stm(NO_TREC);
}