It also includes check to ensure that number of
per-cpu mheaps is not lower than number of cpus.
Change-Id: Ibc68b34dda130f922243f9ea15b03e44bbcac269
Signed-off-by: Damjan Marion <damarion@cisco.com>
#define VLIB_MAX_CPUS 256
#define VLIB_MAX_CPUS 256
+#if VLIB_MAX_CPUS > CLIB_MAX_MHEAPS
+#error Please increase number of per-cpu mheaps
+#endif
+
#define VLIB_CPU_MASK (VLIB_MAX_CPUS - 1) /* 0x3f, max */
#define VLIB_OFFSET_MASK (~VLIB_CPU_MASK)
#define VLIB_CPU_MASK (VLIB_MAX_CPUS - 1) /* 0x3f, max */
#define VLIB_OFFSET_MASK (~VLIB_CPU_MASK)
#include <vppinfra/string.h> /* memcpy, memset */
#include <vppinfra/valgrind.h>
#include <vppinfra/string.h> /* memcpy, memset */
#include <vppinfra/valgrind.h>
+#define CLIB_MAX_MHEAPS 256
+
-extern void * clib_per_cpu_mheaps[32];
+extern void * clib_per_cpu_mheaps[CLIB_MAX_MHEAPS];
always_inline void * clib_mem_get_per_cpu_heap (void)
{
always_inline void * clib_mem_get_per_cpu_heap (void)
{
-void * clib_per_cpu_mheaps[32];
+void * clib_per_cpu_mheaps[CLIB_MAX_MHEAPS];
void clib_mem_exit (void)
{
void clib_mem_exit (void)
{