X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Fmheap_bootstrap.h;h=38f0ac84fa974e1d7e70f1f98c12d657b3473541;hb=487507f40f4e443ff1e683641206db80875f3477;hp=4b21051bfcca42d23c59e01938bac8cdc5bf0abc;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vppinfra/mheap_bootstrap.h b/src/vppinfra/mheap_bootstrap.h index 4b21051bfcc..38f0ac84fa9 100644 --- a/src/vppinfra/mheap_bootstrap.h +++ b/src/vppinfra/mheap_bootstrap.h @@ -160,11 +160,23 @@ typedef struct uword *trace_index_by_offset; } mheap_trace_main_t; +/* Without vector instructions don't bother with small object cache. */ +#ifdef CLIB_HAVE_VEC128 +#define MHEAP_HAVE_SMALL_OBJECT_CACHE 1 +#else +#define MHEAP_HAVE_SMALL_OBJECT_CACHE 0 +#endif + /* Small object bin i is for objects with user_size > sizeof (mheap_elt_t) + sizeof (mheap_elt_t) * (i - 1) user_size <= sizeof (mheap_elt_t) + sizeof (mheap_size_t) * i. */ +#if MHEAP_HAVE_SMALL_OBJECT_CACHE > 0 #define MHEAP_LOG2_N_SMALL_OBJECT_BINS 8 #define MHEAP_N_SMALL_OBJECT_BINS (1 << MHEAP_LOG2_N_SMALL_OBJECT_BINS) +#else +#define MHEAP_LOG2_N_SMALL_OBJECT_BINS 0 +#define MHEAP_N_SMALL_OBJECT_BINS 0 +#endif #define MHEAP_N_BINS \ (MHEAP_N_SMALL_OBJECT_BINS \ @@ -188,18 +200,6 @@ typedef struct u64 n_clocks_get, n_clocks_put; } mheap_stats_t; -/* Without vector instructions don't bother with small object cache. */ -#ifdef CLIB_HAVE_VEC128 -#define MHEAP_HAVE_SMALL_OBJECT_CACHE 1 -#else -#define MHEAP_HAVE_SMALL_OBJECT_CACHE 0 -#endif - -#if CLIB_VEC64 > 0 -#undef MHEAP_HAVE_SMALL_OBJECT_CACHE -#define MHEAP_HAVE_SMALL_OBJECT_CACHE 0 -#endif - /* For objects with align == 4 and align_offset == 0 (e.g. vector strings). */ typedef struct {