From bb5d350fbcc6df682c68a38f2d0c00e7f9505c97 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Wed, 4 Oct 2017 21:55:24 +0200 Subject: [PATCH] Fix missing VLA for C++ --- tests/test-mbuffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test-mbuffer.c b/tests/test-mbuffer.c index 293b7eec..27ff6696 100644 --- a/tests/test-mbuffer.c +++ b/tests/test-mbuffer.c @@ -322,6 +322,7 @@ static void prod2(void *arg) static void test_queue(size_t n, int cpu_count, unsigned long long ref) { + cpu_count = M_MIN(cpu_count, 64); const int prod_count = cpu_count / 2; const int conso_count = cpu_count - prod_count; @@ -330,8 +331,8 @@ static void test_queue(size_t n, int cpu_count, unsigned long long ref) queue_ull_init (g_final2, 64*2); // Create thread - m_thread_t idx_p[prod_count]; - m_thread_t idx_c[conso_count]; + m_thread_t idx_p[64]; + m_thread_t idx_c[64]; m_thread_t idx_final; for(int i = 0; i < prod_count; i++) { m_thread_create (idx_p[i], prod2, &n);