aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/mheap.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-05-17 20:20:50 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2017-05-18 15:38:52 +0000
commitba7ddfe9b77771c47f99df5475e6e92b8d80816e (patch)
tree3c04fc256af5828fbaf1934bb2f91ae7daadbbee /src/vppinfra/mheap.c
parent287ca3c9162456a93380f55090354e3ce0e7cb2f (diff)
VPP-847: improve bihash template memory allocator performance
Particularly in the DCLIB_VEC64=1 case, using vectors vs. raw clib_mem_alloc'ed memory causes abysmal memory allocator performance. Change-Id: I07a4dec0cd69ca357445385e2671cdf23c59b95d Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra/mheap.c')
-rw-r--r--src/vppinfra/mheap.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/vppinfra/mheap.c b/src/vppinfra/mheap.c
index d4010ceb297..5bbbc65f8f1 100644
--- a/src/vppinfra/mheap.c
+++ b/src/vppinfra/mheap.c
@@ -549,23 +549,17 @@ mheap_get_search_free_list (void *v,
non_empty_bin_mask &= ~pow2_mask (bin % BITS (uword));
/* Search each occupied free bin which is large enough. */
- foreach_set_bit (bi, non_empty_bin_mask, (
- {
- uword r =
- mheap_get_search_free_bin (v,
- bi
- +
- i
- *
- BITS
- (uword),
- n_user_bytes_arg,
- align,
- align_offset);
- if (r !=
- MHEAP_GROUNDED) return
- r;}
- ));
+ /* *INDENT-OFF* */
+ foreach_set_bit (bi, non_empty_bin_mask,
+ ({
+ uword r =
+ mheap_get_search_free_bin (v, bi + i * BITS (uword),
+ n_user_bytes_arg,
+ align,
+ align_offset);
+ if (r != MHEAP_GROUNDED) return r;
+ }));
+ /* *INDENT-ON* */
}
return MHEAP_GROUNDED;