Skip to content

Commit

Permalink
lib: libc: malloc.c: fix calculation of sys heap
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Marek Matej committed Jan 31, 2025
1 parent 87f8b98 commit b222b78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/libc/common/source/stdlib/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b222b78

Please sign in to comment.