Skip to content

Commit

Permalink
Don't skip blocks with a lot of _free_ memory.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/branches/compact_pool_revamp@45805 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
bacek committed Apr 19, 2010
1 parent 4bb2e4f commit 34894de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gc/alloc_resources.c
Expand Up @@ -600,7 +600,8 @@ pad_pool_size(ARGIN(const Variable_Size_Pool *pool),
size_t skip_pos = 0;

while (cur_block) {
if (cur_block->size * 0.2 > cur_block->freed) {
if ((cur_block->size * 0.2 > cur_block->freed)
&& (cur_block->free < cur_block->size * 0.2)) {
/* Don't reclaim almost filled blocks */
/* TODO Keep blocks ordered by block->start to use binary search */
skip_blocks[skip_pos++] = cur_block;
Expand Down

0 comments on commit 34894de

Please sign in to comment.