X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Fpool.h;h=8b39a914eb5854518102e6fe5b465a5f96582936;hb=eb987d3a09f669787014b1553f032219522149e1;hp=14c6a75c13b3b6b16af14c64b0fd3893c16eda75;hpb=432bf677c6decadd05e3edfe54c02b1d01b2c64e;p=vpp.git diff --git a/src/vppinfra/pool.h b/src/vppinfra/pool.h index 14c6a75c13b..8b39a914eb5 100644 --- a/src/vppinfra/pool.h +++ b/src/vppinfra/pool.h @@ -190,6 +190,8 @@ do { \ pool_header_t * _pool_var (p) = pool_header (P); \ uword _pool_var (l); \ \ + STATIC_ASSERT(A==0 || ((A % sizeof(P[0]))==0) || ((sizeof(P[0]) % A) == 0), \ + "Pool aligned alloc of incorrectly sized object"); \ _pool_var (l) = 0; \ if (P) \ _pool_var (l) = vec_len (_pool_var (p)->free_indices); \