diff options
author | Evan Huus <eapache@gmail.com> | 2013-07-29 16:55:02 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-07-29 16:55:02 +0000 |
commit | 44d53b4042267f2d8966cbd99405d54c5142dbc6 (patch) | |
tree | c85f2d6d62fd19343b4f06e686ac47fbfc410392 /epan/wmem/wmem_allocator_block.c | |
parent | 0fb6d9650723db6483a1b7bc8811280d72efedb1 (diff) |
More little optimizations.
svn path=/trunk/; revision=51014
Diffstat (limited to 'epan/wmem/wmem_allocator_block.c')
-rw-r--r-- | epan/wmem/wmem_allocator_block.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/epan/wmem/wmem_allocator_block.c b/epan/wmem/wmem_allocator_block.c index 7cd34cc153..5887d5b367 100644 --- a/epan/wmem/wmem_allocator_block.c +++ b/epan/wmem/wmem_allocator_block.c @@ -606,9 +606,8 @@ wmem_block_split_free_chunk(wmem_block_allocator_t *allocator, extra->used = FALSE; /* Correctly update the following chunk's back-pointer */ - chunk = WMEM_CHUNK_NEXT(extra); - if (chunk) { - chunk->prev = extra->len; + if (!last) { + WMEM_CHUNK_NEXT(extra)->prev = extra->len; } } @@ -640,7 +639,7 @@ wmem_block_split_used_chunk(wmem_block_allocator_t *allocator, /* preserve a few values from chunk that we'll need to manipulate */ last = chunk->last; - available = chunk->len; + available = chunk->len - aligned_size; /* set new values for chunk */ chunk->len = (guint32) aligned_size; @@ -649,7 +648,6 @@ wmem_block_split_used_chunk(wmem_block_allocator_t *allocator, /* with chunk's values set, we can use the standard macro to calculate * the location and size of the new free chunk */ extra = WMEM_CHUNK_NEXT(chunk); - available -= chunk->len; /* set the new values for the chunk */ extra->len = (guint32) available; |