From 3aa46e6af0e5f176cbfe147d1727bf16dc9472b9 Mon Sep 17 00:00:00 2001 From: Maciej Bocianski Date: Fri, 3 Nov 2017 15:32:08 +0100 Subject: [PATCH] small supplement for PR #5338 --- TESTS/mbedmicro-rtos-mbed/malloc/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TESTS/mbedmicro-rtos-mbed/malloc/main.cpp b/TESTS/mbedmicro-rtos-mbed/malloc/main.cpp index daf80719f9..e0fcd355e0 100644 --- a/TESTS/mbedmicro-rtos-mbed/malloc/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/malloc/main.cpp @@ -56,7 +56,7 @@ int main() { // static stack for threads to reduce heap usage on devices with small RAM // and eliminate run out of heap memory problem - MBED_ALIGN(8) uint8_t stack[THREAD_STACK_SIZE * NUM_THREADS]; + uint8_t stack[NUM_THREADS][THREAD_STACK_SIZE]; Thread *thread_list[NUM_THREADS]; int test_time = 15; @@ -64,7 +64,7 @@ int main() // Allocate threads for the test for (int i = 0; i < NUM_THREADS; i++) { - thread_list[i] = new Thread(osPriorityNormal, THREAD_STACK_SIZE, stack + i * THREAD_STACK_SIZE); + thread_list[i] = new Thread(osPriorityNormal, THREAD_STACK_SIZE, stack[i]); if (NULL == thread_list[i]) { allocation_failure = true; } else {