lib: libc: malloc.c: fix calculation of sys heap

Change the condition so that ESP32 SoCs are using `_heap_sentry` to
get actual run-time heap size.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
This commit is contained in:
Marek Matej 2025-01-21 22:37:37 +01:00 committed by Benjamin Cabé
parent f925d0759a
commit 65d2139dc6

View File

@ -101,8 +101,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE];
# define HEAP_BASE ROUND_UP(USED_RAM_END_ADDR, HEAP_ALIGN)
# if defined(CONFIG_XTENSA) && (defined(CONFIG_SOC_FAMILY_INTEL_ADSP) \
|| defined(CONFIG_HAS_ESPRESSIF_HAL))
# if (defined(CONFIG_XTENSA) && defined(CONFIG_SOC_FAMILY_INTEL_ADSP)) \
|| defined(CONFIG_HAS_ESPRESSIF_HAL)
extern char _heap_sentry[];
# define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN)
# else