Skip to content

Commit 3aa46e6

Browse files
maciejbocianskiadbridge
authored andcommitted
small supplement for PR #5338
1 parent 157150e commit 3aa46e6

File tree

1 file changed

+2
-2
lines changed
  • TESTS/mbedmicro-rtos-mbed/malloc

1 file changed

+2
-2
lines changed

TESTS/mbedmicro-rtos-mbed/malloc/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ int main()
5656
{
5757
// static stack for threads to reduce heap usage on devices with small RAM
5858
// and eliminate run out of heap memory problem
59-
MBED_ALIGN(8) uint8_t stack[THREAD_STACK_SIZE * NUM_THREADS];
59+
uint8_t stack[NUM_THREADS][THREAD_STACK_SIZE];
6060

6161
Thread *thread_list[NUM_THREADS];
6262
int test_time = 15;
6363
GREENTEA_SETUP(20, "default_auto");
6464

6565
// Allocate threads for the test
6666
for (int i = 0; i < NUM_THREADS; i++) {
67-
thread_list[i] = new Thread(osPriorityNormal, THREAD_STACK_SIZE, stack + i * THREAD_STACK_SIZE);
67+
thread_list[i] = new Thread(osPriorityNormal, THREAD_STACK_SIZE, stack[i]);
6868
if (NULL == thread_list[i]) {
6969
allocation_failure = true;
7070
} else {

0 commit comments

Comments
 (0)