summaryrefslogtreecommitdiff
path: root/rts/sm/Evac.c
diff options
context:
space:
mode:
authorSimon Marlow <simonmarhaskell@gmail.com>2008-04-16 21:34:36 +0000
committerSimon Marlow <simonmarhaskell@gmail.com>2008-04-16 21:34:36 +0000
commit2aa877f8588da099351ef51efca3605fd87ea768 (patch)
treeae385ff59f87667d8357ffc4a745e73fdd867275 /rts/sm/Evac.c
parentea661992b7397eddee145b80a449c40ab565fd12 (diff)
downloadhaskell-2aa877f8588da099351ef51efca3605fd87ea768.tar.gz
GC: rearrange storage to reduce memory accesses in the inner loop
Diffstat (limited to 'rts/sm/Evac.c')
-rw-r--r--rts/sm/Evac.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c
index 0a47c3bc7f..4c386f75df 100644
--- a/rts/sm/Evac.c
+++ b/rts/sm/Evac.c
@@ -55,13 +55,12 @@ alloc_for_copy (nat size, step *stp)
}
}
- ws = &gct->steps[stp->gen_no][stp->no];
+ ws = &gct->steps[stp->abs_no];
+ // this compiles to a single mem access to stp->abs_no only
/* chain a new block onto the to-space for the destination step if
* necessary.
*/
-
- ASSERT(ws->todo_free >= ws->todo_bd->free && ws->todo_free <= ws->todo_lim);
to = ws->todo_free;
if (to + size > ws->todo_lim) {
to = gc_alloc_todo_block(ws);
@@ -141,7 +140,7 @@ evacuate_large(StgPtr p)
}
}
- ws = &gct->steps[new_stp->gen_no][new_stp->no];
+ ws = &gct->steps[new_stp->abs_no];
bd->flags |= BF_EVACUATED;
bd->step = new_stp;
bd->gen_no = new_stp->gen_no;