Little things make big differences: somehow while I was experimenting this

unobtrusive if statement got dropped. Without it the allocator exhibits the old
bad behaviour of 3x memory usage and heavy fragmentation.

We want it back, thank you very much.

svn path=/trunk/; revision=50960
This commit is contained in:
Evan Huus 2013-07-27 23:35:59 +00:00
parent 9b9467cb79
commit e7dfea82f3
1 changed files with 3 additions and 1 deletions

View File

@ -368,7 +368,9 @@ wmem_block_add_to_recycler(wmem_block_allocator_t *allocator,
WMEM_GET_FREE(free_chunk->next)->prev = chunk;
WMEM_GET_FREE(free_chunk->prev)->next = chunk;
allocator->recycler_head = chunk;
if (chunk->len > allocator->recycler_head->len) {
allocator->recycler_head = chunk;
}
}
}