diff --git a/arch/risc-v/src/esp32c3/esp32c3_textheap.c b/arch/risc-v/src/esp32c3/esp32c3_textheap.c index 35a09bc6b9..52be45fe13 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_textheap.c +++ b/arch/risc-v/src/esp32c3/esp32c3_textheap.c @@ -110,3 +110,29 @@ void up_textheap_free(void *p) } } } + +/**************************************************************************** + * Name: up_textheap_heapmember() + * + * Description: + * Test if memory is from text heap. + * + ****************************************************************************/ + +bool up_textheap_heapmember(void *p) +{ + if (p == NULL) + { + return false; + } + +#ifdef CONFIG_ESP32C3_RTC_HEAP + if (esp32c3_ptr_rtc(p)) + { + return esp32c3_rtcheap_heapmember(p); + } +#endif + + p -= D_I_BUS_OFFSET; + return kmm_heapmember(p); +}