summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vlib/vlib/threads.h4
-rw-r--r--vppinfra/vppinfra/mem.h4
-rw-r--r--vppinfra/vppinfra/mem_mheap.c2
3 files changed, 8 insertions, 2 deletions
diff --git a/vlib/vlib/threads.h b/vlib/vlib/threads.h
index 98f19c442e3..6c16878a5b5 100644
--- a/vlib/vlib/threads.h
+++ b/vlib/vlib/threads.h
@@ -50,6 +50,10 @@ typedef struct vlib_thread_registration_ {
#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)
diff --git a/vppinfra/vppinfra/mem.h b/vppinfra/vppinfra/mem.h
index 938f2d23502..301bcdd0d32 100644
--- a/vppinfra/vppinfra/mem.h
+++ b/vppinfra/vppinfra/mem.h
@@ -46,8 +46,10 @@
#include <vppinfra/string.h> /* memcpy, memset */
#include <vppinfra/valgrind.h>
+#define CLIB_MAX_MHEAPS 256
+
/* Per CPU heaps. */
-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)
{
diff --git a/vppinfra/vppinfra/mem_mheap.c b/vppinfra/vppinfra/mem_mheap.c
index e25ae35b77a..5718c8ce618 100644
--- a/vppinfra/vppinfra/mem_mheap.c
+++ b/vppinfra/vppinfra/mem_mheap.c
@@ -50,7 +50,7 @@ clib_smp_main_t clib_smp_main = {
.n_tls_4k_pages = 1,
};
-void * clib_per_cpu_mheaps[32];
+void * clib_per_cpu_mheaps[CLIB_MAX_MHEAPS];
void clib_mem_exit (void)
{