diff options
author | Simon Marlow <simonmarhaskell@gmail.com> | 2008-04-16 21:34:36 +0000 |
---|---|---|
committer | Simon Marlow <simonmarhaskell@gmail.com> | 2008-04-16 21:34:36 +0000 |
commit | 2aa877f8588da099351ef51efca3605fd87ea768 (patch) | |
tree | ae385ff59f87667d8357ffc4a745e73fdd867275 /rts/sm/Evac.c | |
parent | ea661992b7397eddee145b80a449c40ab565fd12 (diff) | |
download | haskell-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.c | 7 |
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; |