vppinfra: correct fixed pool header size calculation 99/25399/2
authorDave Barach <dave@barachs.net>
Mon, 24 Feb 2020 14:19:12 +0000 (09:19 -0500)
committerDamjan Marion <dmarion@me.com>
Mon, 24 Feb 2020 15:47:07 +0000 (15:47 +0000)
Remove duplicate space allocation for the pool header. Not significant
w/ CLIB_CACHE_LINE_BYTES >= 64 since the code rounds the size of the
pool header to an even multiple of the cache line size.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I923f2a60e7565cf2dfbc18d78264bf82ff30c926

src/vppinfra/pool.c

index ed04eb6..30848d5 100644 (file)
@@ -55,9 +55,7 @@ _pool_init_fixed (void **pool_ptr, u32 elt_size, u32 max_elts)
   ASSERT (elt_size);
   ASSERT (max_elts);
 
-  vector_size = pool_aligned_header_bytes + vec_header_bytes (0)
-    + (u64) elt_size *max_elts;
-
+  vector_size = pool_aligned_header_bytes + (u64) elt_size *max_elts;
   free_index_size = vec_header_bytes (0) + sizeof (u32) * max_elts;
 
   /* Round up to a cache line boundary */