Skip to content

Commit 65d2139

Browse files
Marek Matejkartben
authored andcommitted
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 <[email protected]>
1 parent f925d07 commit 65d2139

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/libc/common/source/stdlib/malloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE];
101101

102102
# define HEAP_BASE ROUND_UP(USED_RAM_END_ADDR, HEAP_ALIGN)
103103

104-
# if defined(CONFIG_XTENSA) && (defined(CONFIG_SOC_FAMILY_INTEL_ADSP) \
105-
|| defined(CONFIG_HAS_ESPRESSIF_HAL))
104+
# if (defined(CONFIG_XTENSA) && defined(CONFIG_SOC_FAMILY_INTEL_ADSP)) \
105+
|| defined(CONFIG_HAS_ESPRESSIF_HAL)
106106
extern char _heap_sentry[];
107107
# define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN)
108108
# else

0 commit comments

Comments
 (0)