Fix mheap_get_aligned() performance jackpot 85/13285/2
authorDave Barach <dave@barachs.net>
Thu, 28 Jun 2018 14:59:05 +0000 (10:59 -0400)
committerFlorin Coras <florin.coras@gmail.com>
Thu, 28 Jun 2018 16:33:36 +0000 (16:33 +0000)
commit9c949e72a473195c10a1c1caf503db9467c93f9a
treef44a2128cd25735f553cc9a494a4b12e2580d085
parent7e12d949a346d2e69afb7a8029c0099b5f131b25
Fix mheap_get_aligned() performance jackpot

If non-trivial alignment (e.g. 64) requested, and the object size
(e.g. 16) is smaller than (alignment_request -
MHEAP_ELT_OVERHEAD_BYTES), round up the size request.

This avoids creating remainder chunks, which are
false-cache-line-sharing bait to begin with.

Change-Id: Ie1a21286d29557d125bb346254b1be2def868b1a
Signed-off-by: Dave Barach <dave@barachs.net>
src/vppinfra/mheap.c
src/vppinfra/test_mheap.c