From 7215a3051a5190daf8a3d969749256e5a14226ed Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 1 Jul 2025 04:17:40 +0200 Subject: [PATCH] malloc04: Fix for BSPs with multiple memory areas Some BSPs provide multiple memory areas. Make them empty. --- testsuites/libtests/malloc04/init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testsuites/libtests/malloc04/init.c b/testsuites/libtests/malloc04/init.c index a9894d59fd..f9a2e1b555 100644 --- a/testsuites/libtests/malloc04/init.c +++ b/testsuites/libtests/malloc04/init.c @@ -125,6 +125,12 @@ rtems_task Init( sbrk_count = 0; offset = 256; _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset ); + + /* Some BSPs provide multiple memory areas. Make them empty. */ + for ( i = 1; i < _Memory_Get_count( mem ); ++i ) { + _Memory_Initialize_by_size( _Memory_Get_area( mem, i ), NULL, 0 ); + } + _Malloc_Initialize(); errno = 0;