aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-01-15 08:03:17 -0800
committerDave Barach <openvpp@barachs.net>2019-01-18 15:56:36 +0000
commitf9240dc9207b677038183ca29888d4be89bb88d5 (patch)
treed607d7183e668d9591a03c0a720e8e0855762a6f /src/vppinfra
parentd75320988853736b3d497ccb3f054bc8cc27b207 (diff)
vcl: move forking logic to vls
Change-Id: I721542aca139d7908a4f917629856f82cae79962 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/pool.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/vppinfra/pool.h b/src/vppinfra/pool.h
index 10262e90ec7..747a7170800 100644
--- a/src/vppinfra/pool.h
+++ b/src/vppinfra/pool.h
@@ -352,18 +352,21 @@ do { \
typeof (P) _pool_var (new) = 0; \
pool_header_t * _pool_var (ph), * _pool_var (new_ph); \
u32 _pool_var (n) = pool_len (P); \
- _pool_var (new) = _vec_resize (_pool_var (new), _pool_var (n), \
- _pool_var (n) * sizeof ((P)[0]), \
- pool_aligned_header_bytes, (A)); \
- clib_memcpy_fast (_pool_var (new), (P), \
- _pool_var (n) * sizeof ((P)[0])); \
- _pool_var (ph) = pool_header (P); \
- _pool_var (new_ph) = pool_header (_pool_var (new)); \
- _pool_var (new_ph)->free_bitmap = \
- clib_bitmap_dup (_pool_var (ph)->free_bitmap); \
- _pool_var (new_ph)->free_indices = \
- vec_dup (_pool_var (ph)->free_indices); \
- _pool_var (new_ph)->max_elts = _pool_var (ph)->max_elts; \
+ if ((P)) \
+ { \
+ _pool_var (new) = _vec_resize (_pool_var (new), _pool_var (n), \
+ _pool_var (n) * sizeof ((P)[0]), \
+ pool_aligned_header_bytes, (A)); \
+ clib_memcpy_fast (_pool_var (new), (P), \
+ _pool_var (n) * sizeof ((P)[0])); \
+ _pool_var (ph) = pool_header (P); \
+ _pool_var (new_ph) = pool_header (_pool_var (new)); \
+ _pool_var (new_ph)->free_bitmap = \
+ clib_bitmap_dup (_pool_var (ph)->free_bitmap); \
+ _pool_var (new_ph)->free_indices = \
+ vec_dup (_pool_var (ph)->free_indices); \
+ _pool_var (new_ph)->max_elts = _pool_var (ph)->max_elts; \
+ } \
_pool_var (new); \
})