diff options
author | simonmar <unknown> | 2005-06-13 12:29:49 +0000 |
---|---|---|
committer | simonmar <unknown> | 2005-06-13 12:29:49 +0000 |
commit | b07f38769e7fb7ff94e9ca7eb8387b582a98bdb2 (patch) | |
tree | 80faf0416de5ba80214f58bab9ba5e3c27c73548 /ghc/rts/FrontPanel.c | |
parent | 15e008483d1934c183f587aaa4fb42dc326095dc (diff) | |
download | haskell-b07f38769e7fb7ff94e9ca7eb8387b582a98bdb2.tar.gz |
[project @ 2005-06-13 12:29:48 by simonmar]
Block allocator performance fix: instead of keeping the free list
ordered, keep it doubly-linked, and introduce a new flag BF_FREE so we
can tell when a block is free. We can still coalesce blocks on the
free list because block descriptors are kept consecutively in memory,
so we can tell based on the BF_FREE flag whether to coalesce with the
next higher/lower blocks when freeing a block.
This (almost) make freeChain O(n) rather than O(n^2), and has been
reported to help a lot when dealing with very large heaps.
Diffstat (limited to 'ghc/rts/FrontPanel.c')
-rw-r--r-- | ghc/rts/FrontPanel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ghc/rts/FrontPanel.c b/ghc/rts/FrontPanel.c index c2635205e0..e6126c15de 100644 --- a/ghc/rts/FrontPanel.c +++ b/ghc/rts/FrontPanel.c @@ -400,7 +400,7 @@ updateFrontPanel( void ) for (; a <= LAST_BLOCK(m); (char *)a += BLOCK_SIZE) { bd = Bdescr((P_)a); ASSERT(bd->start == a); - if (bd->free == (void *)-1) { + if (bd->flags & BF_FREE) { colorBlock( a, &free_color, block_width, block_height, blocks_per_line ); } else { |